OOP paradigm, principles of good design and architecture of Java applications


Published on

Not so many developers are clearly make a distinction between design and architecture, and the experience of the interviews shows that the basic paradigm of OOP often cause difficulty. Java language is quite old and not all principles were implemented properly in it, and the abundance of frameworks further confuses developers. This presentation will discuss the basics of OOP and modern look on them, the benefits and harms of inheritance, interfaces, and the applicability of the opportunities that they offer for the ever-growing project. It will also consider the appearance of the normal cycle of code to work on TDD, how to postpone the architectural and design solutions until the right moment, tried and tested over the years architectural design patterns, principles of good code design. This talk will be useful to those who want to create high-quality, understandable and easy to support solutions in Java.

Published in: Technology, Education

OOP paradigm, principles of good design and architecture of Java applications

  1. 1. OOP paradigm, the basics of good design and architecture of Java applications Mikalai Alimenkou http://xpinjection.com @xpinjection
  2. 2. Disclaimer This is all my personal experience
  3. 3. #1. Use interfaces everywhere • • • • • Clear protocols Natural TDD cycle Delayed transport decisions Easy logic extension Simple scalability
  4. 4. #2. Inheritance is evil • • • • Current and future behavior inherited ‘Protected’ breaks encapsulation Long inheritance chains is hell Dependencies on frameworks inherited
  5. 5. #3. ‘Natural’ encapsulation POJO bullshit game
  6. 6. #4. SOLID design principles • • • • • SRP – Single Responsibility Principle OCP – Open/Closed Principle LSP – Liskov Substitution Principle ISP – Interface Segregation Principle DIP – Dependency Inversion Principle Don’t forget about: DRY + KISS + YAGNI
  7. 7. #5. DAO layer for data access
  8. 8. #6. All logic is in services
  9. 9. #7. Don’t rely on frameworks Are you crazy?
  10. 10. And remember…
  11. 11. @xpinjection http://xpinjection.com mikalai.alimenkou@xpinjection.com