Principles of Object Oriented Design

Embed Size (px)

DESCRIPTION

Dependency Inversion PrincipleInterface Segregation Principle

Citation preview

  • 1. Principle of Object Oriented Design
    • New Frontier Solutions

Dependency Inversion Principle Interface Segregation Principle Jon Kartago Lamida http://lamida.net 2. Agenda

  • Principle of Object Oriented Design

3. DIP 4. ISP 5. Prerequisite

  • Basic OOP Concept

6. SRP 7. OCP 8. LSP 9. Dependency Inversion Principle

  • Depend upon Abstractions. Do not depend uponconcretions.

10. Dependency Structure Procedural Architecture 11. Dependency Structure Object Oriented Architecture 12. Copy Program 13. Copy Program 14. Copy Program with DIP 15. Copy Program with DIP 16. DIP Summary

  • High level modules should not depend low level moduls. Both should depend upon absraction

17. Abstraction should not depend upon detail. Detail should depend upon abstraction 18. Since the abstractions and details are all isolated from each other, the code is much easier to maintain. 19. The Interface Segregation Principle

  • Many client specific interfaces are better than one general purpose interface

20. Fat Service with Integrated Interfaces 21. Fat Service with Integrated Interfaces 22. Segregated Interfaces 23. Segregated Interfaces 24. Door Application 25. Door Application 26. Door Application 27. Door Application 28. ISP Summary

  • Client should not be forced to depend upon interfaces that they do not use

29. E.g WoodDoor should not be forced depend to TimerClient 30. Segregate TimerClient hierarchy so only client whoneed that will implement 31. Discussion

  • Thank you