Presentation is loading. Please wait.

Presentation is loading. Please wait.

Some principles for object oriented design

Similar presentations


Presentation on theme: "Some principles for object oriented design"— Presentation transcript:

1 Some principles for object oriented design
SOLID Some principles for object oriented design

2 Overview Single responsibility principle Open/closed principle
Liskov substitution principle Interface segregation principle Dependency inversion principle

3 Citations Single responsibility principle Open/closed principle
a class should have only a single responsibility (i.e. changes to only one part of the software's specification should be able to affect the specification of the class). Open/closed principle "software entities … should be open for extension, but closed for modification." Liskov’s substitution principle "objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program." See also design by contract. Interface segregation principle "many client-specific interfaces are better than one general-purpose interface." Dependency inversion principle one should "depend upon abstractions, [not] concretions.”

4 References to SDP Single responsibility principle
Similar to the High Cohesion references penetrating the first OO course up till SDP Open/closed principle Everything that has to do with inheritance in the projects, for example the abstract classes Liskov’s substitution principle Whenever we abstain from concrete classes, as in SuperController’s superinit Interface segregation principle For example the three main interfaces for building SVG in simplediagram Dependency inversion principle We use the Action interface in stead of concrete instances to build user controls for the Controller classes


Download ppt "Some principles for object oriented design"

Similar presentations


Ads by Google