> Markdown version of [/videos/513-oop-revisited?t=2](https://www.wearedevelopers.com/videos/513-oop-revisited?t=2). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # OOP revisited Stop treating classes as mere data structures. Rediscover core OOP principles to escape fragile framework conventions and build truly decoupled, maintainable software. - **Speakers:** Dominik Przybysz - **Event:** WeAreDevelopers LIVE - **Published:** September 21, 2022 - **Duration:** 48:42 - **URL:** https://www.wearedevelopers.com/videos/513-oop-revisited ## Summary Object-Oriented Programming (OOP) principles are often overlooked in favor of framework-specific conventions, leading to fragile and tightly coupled code. This talk revisits the core tenets of OOP—encapsulation, abstraction, inheritance, and polymorphism—to demonstrate how developers can design more robust and maintainable software. By moving away from treating classes as mere data structures (like Java Beans with auto-generated getters and setters), developers can build true "capsules" that expose domain-meaningful operations and protect their internal state. Applying established methodologies like SOLID and GRASP, the session explores practical techniques for delegating responsibilities and minimizing coupling. Key concepts such as the "tell, don't ask" principle and the "information expert" pattern encourage objects to manage their own validation and logic. Furthermore, the discussion highlights the importance of dependency inversion and interface segregation in avoiding leaky abstractions, illustrating how approaches like hexagonal architecture can isolate domain logic from infrastructure concerns. Ultimately, developers are encouraged to make deliberate design decisions rather than relying on default language features. While inheritance is a powerful tool, it introduces tight coupling and should be carefully weighed against composition. By actively evaluating cohesion metrics (like LCOM4) and using tools such as CRC cards, teams can craft APIs that evolve cleanly through thoughtful polymorphism, ensuring their codebases remain scalable and resilient over time. **Keywords:** OOP principles, software encapsulation techniques, composition over inheritance, SOLID principles, GRASP patterns, tell don't ask principle, information expert pattern, java beans anti-pattern, hexagonal architecture, dependency inversion, LCOM4 cohesion metric, software coupling reduction, interface segregation, liskov substitution, leaky abstractions, CRC cards methodology ## Chapters 1. **Core definitions and principles of object-oriented programming** (00:02) — Modeling programs as communicating objects relies on foundational structural design principles. 1. **Encapsulation strategies for avoiding anemic domain models** (03:07) — Replacing default getters and setters with domain-specific operations secures internal state. 1. **Abstraction and delegating logic through information experts** (11:36) — Hiding implementation details and assigning logic to data-holding objects reduces system complexity. 1. **Managing single responsibilities with cohesion and coupling metrics** (19:21) — Measuring lack of cohesion helps split classes while visual exercises aid in minimizing module coupling. 1. **Dependency inversion for clean architectural boundaries and abstractions** (23:31) — Relying on stable interfaces rather than concrete classes prevents leaky abstractions in domain logic. 1. **Inheritance constraints and prioritizing composition over inheritance** (29:44) — Respecting substitution contracts and open-closed principles prevents rigid class hierarchies and unintended coupling. 1. **Leveraging polymorphism for robust application programming interfaces** (39:56) — Using method overriding and overloading enables flexible and gracefully evolving software contracts. 1. **Key takeaways and developer reflections on language choices** (43:23) — Deliberate software design choices matter more than blindly applying convenient language features. ## Related Moments - [Spotting common object-oriented programming abusers in applications](https://www.wearedevelopers.com/videos/1047-identifying-code-smells) (from "Identifying code smells") - [Defining the core principles of clean code](https://www.wearedevelopers.com/videos/515-dirty-tests-and-how-to-clean-them) (from "Dirty Tests And How To Clean Them") - [Learning Java features and design patterns interactively](https://www.wearedevelopers.com/videos/536-chatgpt-and-java-a-match-made-in-heaven-or-hell) (from "ChatGPT and Java: A Match Made in Heaven or Hell?") - [Re-evaluating core programming principles in web architecture](https://www.wearedevelopers.com/videos/1427-how-to-kill-javascript-from-your-stack-with-htmx-and-kotlin) (from "How to kill JavaScript from your Stack with HTMX and Kotlin") - [The rise of object-oriented programming in the eighties](https://www.wearedevelopers.com/videos/611-from-punch-cards-to-ai-assisted-development) (from "From Punch Cards to AI-assisted Development") - [Mastering foundational programming knowledge before skipping to abstractions](https://www.wearedevelopers.com/videos/1380-wearedevelopers-live-what-development-and-tattoos-have-in-common-and-more) (from "WeAreDevelopers LIVE - What Development and Tattoos Have in Common and more") ## Related Articles - [How to Avoid Over-Engineering](https://www.wearedevelopers.com/magazine/546-how-to-avoid-over-engineering) - [Using Java 17 latest features in real world projects](https://www.wearedevelopers.com/magazine/121-using-java-17-latest-features-in-real-world-projects) - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) - [Dev Digest 138 - Are you secure about this?](https://www.wearedevelopers.com/magazine/486-dev-digest-138-are-you-secure-about-this) ## Related Jobs - [Founding Developer Advocate](https://www.wearedevelopers.com/jobs/48425-founding-developer-advocate) at **Plumber** - [Senior Open Source Advisor](https://www.wearedevelopers.com/jobs/ext/1278113-senior-open-source-advisor) at **ZEISS Group** - [Manager, Engineering, Secure Build and SCS Services](https://www.wearedevelopers.com/jobs/48447-manager-engineering-secure-build-and-scs-services) at **Docker, Inc.** - [Software Engineer, Java (Opshub)](https://www.wearedevelopers.com/jobs/ext/2768059-software-engineer-java-opshub) at **Bitpanda** - [Principal Solutions Architect, Professional Services](https://www.wearedevelopers.com/jobs/ext/2831732-principal-solutions-architect-professional-services) at **Docker, Inc.** - [Senior Software Engineer, Sandboxes (Eu Or East Coast Preferred)](https://www.wearedevelopers.com/jobs/ext/2145616-senior-software-engineer-sandboxes-eu-or-east-coast-preferred) at **Docker, Inc.**