2. 2
AgendaAgenda
What is OO Modeling?
Why OO Modeling?
Odors of rotting software
Basic OO Principles
OO Design Principles and Heuristics
Conclusion
Case Study
3. 3
This session will not:This session will not:
Make you an expert in OOAD
Turn you into a system architect
Provide instruction on UML
4. 4
Warning!Warning!
Most of these slides maps
directly/indirectly to various articles
available on the web, especially from
objectmentor.com
Thanks Bob!
6. 6
Why OO ModelingWhy OO Modeling
To Manage
Change
To Manage
Change
To Deliver
Faster
To Deliver
Faster
To Deal with
Complexity
To Deal with
Complexity
12. 12
Single Responsibility Principle [Contd.]Single Responsibility Principle [Contd.]
What is RESPONSIBILITY?
RESPONSIBILITY is reason for change
How to spot multiple RESPONSIBILITIES?
14. 14
Single Responsibility Principle [Contd.]Single Responsibility Principle [Contd.]
Going from multiple responsibilities to single responsibility -
15. 15
Open Close PrincipleOpen Close Principle
Software entities should be open
for extension but closed for
modification.
18. 18
Liskov Substitution PrincipleLiskov Substitution Principle
Subtypes must be substitutable for their base
types.
LSP is all about inheritance – One must be able to substitute subclass by
base class without things going terribly wrong
20. 20
Liskov Substitution Principle [Contd.]Liskov Substitution Principle [Contd.]
Example
Board board = new 3DBoard();
Unit unit = board.getUnits(8,4);
26. 26
Dependency Inversion PrincipleDependency Inversion Principle
a.High-level modules should not depend on low-
level modules. Both should depend on
abstractions
b.Abstractions should not depend upon details.
Details should depend upon abstractions
29. 29
ConclusionConclusion
Good design is needed to successfully deal with change
The main forces driving your design should be high cohesion and low
coupling
SOLID principles put you on the right path
WARNING : these principles cannot be applied blindly :)