On Wednesday, I attended an ๐ข๐ข๐ฃ ๐๐ ๐๐ข๐ฃ discussion that challenged the way I think about software design, complexity, and trade-offs.
๐ค๐๐ถ๐ฐ๐ธ ๐ด๐ฟ๐ผ๐๐ป๐ฑ๐ถ๐ป๐ด ๐ฏ๐ฒ๐ณ๐ผ๐ฟ๐ฒ ๐ฑ๐ถ๐๐ถ๐ป๐ด ๐ถ๐ป
๐ข๐ฏ๐ท๐ฒ๐ฐ๐-๐ข๐ฟ๐ถ๐ฒ๐ป๐๐ฒ๐ฑ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด (๐ข๐ข๐ฃ) organizes software around objects that bundle data and behavior together. It relies on abstraction, encapsulation, inheritance, and polymorphism.
๐๐ฎ๐๐ฎ-๐ข๐ฟ๐ถ๐ฒ๐ป๐๐ฒ๐ฑ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด (๐๐ข๐ฃ) focuses on modeling data first and driving behavior from that data. It often favors simplicity, immutability, and pattern matching over deep object hierarchies.
๐๐ฒ๐ ๐บ๐ฒ ๐๐๐ฎ๐ฟ๐ ๐๐ถ๐๐ต ๐๐ต๐ฒ ๐๐๐ผ๐ฟ๐๐๐ฒ๐น๐น๐ถ๐ป๐ด
The way Dr. Venkat Subramaniam teaches is refreshing.
A three-hour workshop felt like a thirty-minute conversation.
No slides.
Just live typing in Notepad, thinking out loud, and building ideas step by step.
As a visual learner, this style really worked for me. It was easy to follow and very different from the usual conference-style presentations.
๐ก๐ผ๐ ๐๐ผ ๐๐ต๐ฒ ๐ฐ๐ผ๐ป๐๐ฒ๐ป๐
Java has been centered around Object-Oriented Programming for more than thirty years, and as a community, we are deeply attached to its principles. But one question set the tone for the entire session:
๐ ๐๐ณ ๐๐ฒ ๐ณ๐ผ๐น๐น๐ผ๐ ๐ฑ๐ฒ๐๐ถ๐ด๐ป ๐ฝ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ๐ ๐ฏ๐น๐ถ๐ป๐ฑ๐น๐, ๐ฎ๐ป๐ฑ ๐๐ต๐ฒ ๐ฑ๐ฒ๐๐ถ๐ด๐ป ๐ถ๐ ๐๐๐ถ๐น๐น ๐ฏ๐ฎ๐ฑ, ๐ฎ๐ฟ๐ฒ ๐๐ฒ ๐ฟ๐ฒ๐ฎ๐น๐น๐ ๐๐ฒ๐ฟ๐๐ถ๐ป๐ด ๐๐ต๐ฒ ๐ฝ๐๐ฟ๐ฝ๐ผ๐๐ฒ?
Thatโs where the discussion got interesting.
๐ฅ๐ฒ๐๐ถ๐๐ถ๐๐ถ๐ป๐ด ๐๐ต๐ฒ ๐ณ๐ผ๐๐ฟ ๐ฝ๐ถ๐น๐น๐ฎ๐ฟ๐ ๐ผ๐ณ ๐ข๐ข๐ฃ
๐๐ฏ๐๐๐ฟ๐ฎ๐ฐ๐๐ถ๐ผ๐ป
Changing behavior without directly changing code, and how humans stay sane when dealing with complexity by focusing on what instead of how.
๐๐ป๐ฐ๐ฎ๐ฝ๐๐๐น๐ฎ๐๐ถ๐ผ๐ป
Implementation hiding, or the separation of what from how. This applies at many levels, from functions and files to classes, components, subsystems, and entire systems.
๐๐ป๐ต๐ฒ๐ฟ๐ถ๐๐ฎ๐ป๐ฐ๐ฒ
Often one of the weakest links of OOP when overused. Instead of defaulting to inheritance, the focus shifted to design by contract and design by capability.
๐ฃ๐ผ๐น๐๐บ๐ผ๐ฟ๐ฝ๐ต๐ถ๐๐บ
Behavior chosen at runtime, not compile time. It often appears with inheritance, but it does not require it and can also be achieved through interfaces, composition, or pattern matching.
This framing made the principles feel less like rigid rules and more like design tools with real trade-offs.
๐๐ฒ๐๐ถ๐ด๐ป ๐ฝ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ๐ ๐ถ๐ป ๐ฎ๐ฐ๐๐ถ๐ผ๐ป
We explored the Open-Closed Principle and Dependency Inversion Principle.
A simple design evolved from:
OrderProcess -> CreditCard
to:
OrderProcess -> PaymentMethod <- CreditCard
Here, OrderProcess depends only on the abstraction, while CreditCard implements that abstraction, keeping high-level logic decoupled from concrete implementations.
๐๐๐ ๐๐ต๐ฒ๐ป ๐ฐ๐ฎ๐บ๐ฒ ๐๐ต๐ฒ ๐ฐ๐ผ๐๐
DRY was violated
Parallel class hierarchies appeared
Code size increased
Complexity grew quickly
Runtime errors became easier to introduce
Exception handling became painful
At some point, it felt like we were managing complexity by naming it.
That led to an important question:
When does the cost of complexity outweigh the benefits?
๐๐ผ๐ผ๐ธ๐ถ๐ป๐ด ๐ฎ๐ ๐๐ข๐ฃ
With DOP, the Open-Closed Principle is violated, and Dependency Inversion is not used.
But in return:
Much less code
No parallel hierarchies
DRY preserved
Simpler logic
Easier exception handling
Compile-time errors when new types are introduced
The contrast was clear.
OOP relies on polymorphism.
DOP relies on pattern matching.
๐ ๐ผ๐ฑ๐ฒ๐ฟ๐ป ๐๐ฎ๐๐ฎ ๐ณ๐ฒ๐ฎ๐๐๐ฟ๐ฒ๐
Records encourage immutability.
Sealed classes give compile-time guarantees by defining a closed set of allowed subtypes.
Switch becomes a powerful pattern-matching tool, not just a control-flow tool.
๐ ๐ ๐ฏ๐ถ๐ด๐ด๐ฒ๐๐ ๐๐ฎ๐ธ๐ฒ๐ฎ๐๐ฎ๐
Both in life and in programming, trade-offs are unavoidable.
I felt this personally. To attend this session, I had to choose between a Toastmasters meeting and the JavaMUG meetup. I could not be in two places at the same time.
Another insight that really stayed with me was Dr. Venkatโs perspective beyond any single language. He works with more than 15 programming languages, and his students often share that thinking beyond a fixed-language mindset helps them solve problems more effectively.
Focusing on thinking, not just syntax, was a powerful reminder.
No paradigm is perfect. What matters most is knowing when and why to use each one.
๐๐๐ฟ๐ถ๐ผ๐๐ ๐๐ผ ๐ต๐ฒ๐ฎ๐ฟ ๐๐ผ๐๐ฟ ๐๐ต๐ผ๐๐ด๐ต๐๐
Are you experimenting with DOP in Java yet, or are you still mostly in the OOP world?
Top comments (0)