Software Design Principles

1,551
-1

Published on

Published in: Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,551
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
44
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Opening customized for each location
  • Software Design Principles

    1. 1. Software Design Principles Navigator Internal Workshop
    2. 2. Old Story Clean Simple Elegant Rigid Fragile Immobile Change with Requirement Out-of-Control Dependencies
    3. 3. Solution Software Development = Complexity Management Change with Requirement and Follow Principles OCP LSP DIP ISP Clean Simple Elegant Huge but still Clean Simple Elegant
    4. 4. Open Close Principle (OCP) A module should be Open for Extension but Close for Modification Solution: Polymorphism
    5. 5. Liskov Substitution Principle (LSP) Subclasses should be Substitutable for their Base Classes
    6. 6. Liskov Substitution Principle (LSP) Root Cause: Is-A Fails <ul><li>Solution: Design by Contract </li></ul><ul><li>Method pre-condition in subclass shouldn’t be stronger than in base class </li></ul><ul><li>Method post-condition in subclass shouldn’t be weaker than in base class </li></ul>
    7. 7. Dependency Inversion Principle (DIP) Depend upon Abstractions. Don't depend upon Concretions. The Last Mile: Where to instantiate the concrete class?
    8. 8. Interface Segregation Principle (ISP) Many client specific interfaces are better than one general purpose interface
    9. 9. Summary <ul><li>Less </li></ul><ul><ul><li>Responsibilities in a Interface/Class </li></ul></ul><ul><ul><li>Dependencies on Outside Classes </li></ul></ul><ul><li>More </li></ul><ul><ul><li>Abstraction to act as Dependency Firewall </li></ul></ul><ul><ul><li>Small Single-Responsibility Class to Encapsulate Change </li></ul></ul>Manage Complexity = Manage Dependencies Clean Simple Elegant Clean Simple Elegant Clean Simple Elegant Clean Simple Elegant Clean Simple Elegant
    10. 10. More Principles <ul><li>Package Cohesion Principles </li></ul><ul><ul><li>REP: Release Reuse Equivalency Principle </li></ul></ul><ul><ul><li>CCP: Common Closure Principle </li></ul></ul><ul><ul><li>CRP: Common Reuse Principle </li></ul></ul><ul><li>Package Coupling Principles </li></ul><ul><ul><li>ACP: Acyclic Dependencies Principle </li></ul></ul><ul><ul><li>SDP: Stable Dependencies Principle </li></ul></ul><ul><ul><li>SAP: Stable Abstractions Principle </li></ul></ul>
    11. 11. Thank you
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×