Own Your Design

Functional Principles The Framework

Tiberiu Tofan

Tiberiu Tofan

About Me

Running on JVM for more than 20 years, navigating between Java, Groovy, Scala, and Kotlin. I focus on maintainable code, continuous delivery, and functional programming principles—from architecture to automated pipelines and testing.

Own Your Design — Functional Principles vs the Framework

A deep-dive technical talk about reclaiming control over your architecture, your boundaries, and your domain. It challenges the "default" layered mindset and shows how functional principles—explicit data modeling, typed error handling, clear boundaries, and inversion of control—help you design systems that are predictable, testable, and framework-agnostic.

The talk follows a practical, step-by-step refactoring of a real application, built twice:

  • In Java — using records, sealed interfaces, functional patterns, and clear domain boundaries that push frameworks to the edges.
  • In Kotlin — showcasing inline classes, context receivers, the Raise DSL, typed errors, and a more expressive functional style.

Through animated examples, visual metaphors, and progressive refactorings, you'll see how design choices ripple through your codebase—from domain modeling to error handling, from integration boundaries to testing strategy.

Key Takeaways — Keep Your Domain SAFE

S

Segregate Interfaces

Small, functional interfaces simplify testing and maintainability.

A

Avoid Ambiguous Types

Use domain-specific types for clarity, validation, and type safety.

F

Fail Explicitly

Represent errors explicitly with domain-friendly Result/Either types—no hidden exceptions.

E

Encapsulate the Domain

Decouple from infrastructure/frameworks and ensure your domain invariants are always protected.

Demo Project

The complete working example demonstrating all concepts from the talk, implemented in both Java and Kotlin.

Videos

Java — ING Hubs Romania Hangouts

Full talk on functional principles with Java sealed interfaces and records, delivered at ING Hubs Romania Hangouts.

Java — DevCon 2025, Bucharest

Recorded on the JavaCon track at DevCon 2025, Bucharest — Nov 5, 2025.

Kotlin Version
Coming soon...

Articles

Deep dive into domain modeling in Kotlin - a comprehensive series on validation, type safety, and inline classes.