12
OOP paradigm, the basics of good design and architecture of Java applications Mikalai Alimenkou http://xpinjection.com @xpinjection

OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

OOP paradigm, the basics of good design and architecture

of Java applications

Mikalai Alimenkou

http://xpinjection.com

@xpinjection

Page 2: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9
Page 3: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

Disclaimer

This is all my personal experience

Page 4: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#1. Use interfaces everywhere

• Clear protocols • Natural TDD cycle • Delayed transport decisions • Easy logic extension • Simple scalability

Page 5: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#2. Inheritance is evil

• Current and future behavior inherited • ‘Protected’ breaks encapsulation • Long inheritance chains is hell • Dependencies on frameworks inherited

Page 6: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#3. ‘Natural’ encapsulation

POJO bullshit game

Page 7: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#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

Page 8: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#5. DAO layer for data access

Page 9: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#6. All logic is in services

Page 10: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

#7. Don’t rely on frameworks

Are you crazy?

Page 11: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

And remember…

Page 12: OOP paradigm, the basics of good design and architecture ......13,550 tweets 51 following 1,219 followers 10,076 tweets 64 following 782 followers organ'zer and speaker: 7 years/ 9

@xpinjection http://xpinjection.com

[email protected]