oop - back to basic
TRANSCRIPT
OOP – Back to Basic!
Gøran HansenSeniorkonsulent, Capgeminihttp://[email protected]/goeran
”Vi kan unngå spagettikode ved å bry oss om kvaliteten på koden vi skriver!”
What does these have in common?
.NET
VB.NET
C# Ruby
Python
Silverlight
Flash
Java
ASP.NET MVC
Ruby on Rails
WPF
Azure
Object Orientation!
Encapsulation, Inheritance, Polymorphism
Loose Coupling
Cohesion
Design Principles
Single Responsibility Principle – SRP
”There should never be more than one reason for the class to change” – Tom DeMarco
http://www.objectmentor.com/resources/articles/srp.pdf
Dependency Inversion Principle – DIP
”High level modules should not depend upon low level modules. Both should depend upon
asbtractions”
”Abstractions should not depend upon details. Details should depend upon abstractions”
- Robert C. Martin (Unclebobmartin)
http://www.objectmentor.com/resources/articles/dip.pdf
Open-Closed Principle – OCP
”Should be open for extensions but closed for modification” – Bertand Meyer (1988)
http://www.objectmentor.com/resources/articles/ocp.pdf
SRPDIPOCP
S.O.L.I.D
”Vi kan unngå spagettikode ved å bry oss om kvaliteten på koden vi skriver!”
Recommended reading
• http://www.objectmentor.com/resources/publishedArticles.html
• http://msdn.microsoft.com/en-us/magazine/cc546578.aspx
• http://blog.objectmentor.com/• http://codebetter.com/blogs/jeremy.miller/
OOP – Back to Basic!
Gøran HansenSeniorkonsulent, Capgeminihttp://[email protected]/goeran