SlideShare a Scribd company logo
1 of 68
Smart People  ·  Smart Solutions
Object Oriented  Design Principles Session 1 – Getting a S.O.L.I.D understanding  of the basic principles
Why do we need to know this? ,[object Object],[object Object],[object Object],[object Object]
What would we like to achieve here… ,[object Object],[object Object],[object Object],[object Object]
The Basic Concepts of OO - Encapsulation ,[object Object]
The Basic Concepts of OO - Abstraction ,[object Object],[object Object]
The Basic Concepts of OO - Inheritance ,[object Object],[object Object]
The Basic Concepts of OO - Polymorphism ,[object Object],[object Object]
The Basic Concepts of OO - Polymorphism public void ShowPolyMorphismExample() { DerivedClass  B  = new DerivedClass(); DoWork( B ); BaseClass  A  = (BaseClass) B ; DoWork( A ); DerivedClass2  C  = new DerivedClass2(); DoWork( C ); } public void DoWork (BaseClass baseClass) { baseClass.DoWork(); } public class  DerivedClass2  :  BaseClass { public override void DoWork() { } public override int WorkProperty { get { return 0; } } } public class  DerivedClass  :  BaseClass { public override void DoWork() { } public override int WorkProperty { get { return 0; } } } public class  BaseClass { public virtual void DoWork() { } public virtual int WorkProperty { get { return 0; } } }
The Basic Concepts of OO – Decoupling ,[object Object],[object Object],[object Object]
The Basic Concepts of OO - Getting a S.O.L.I.D understanding of the basic principles
What is S.O.L.I.D.? ,[object Object]
What is S.O.L.I.D.? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SRP: Single Responsibility Principle ,[object Object]
SRP: Single Responsibility Principle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SRP: Single Responsibility Principle ,[object Object]
SRP – Problem vs Solution [code example] ,[object Object],[object Object],[object Object],[object Object]
SRP – Problem vs Solution [code example] ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SRP – Problem vs Solution [code example] ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SRP – Problem vs Solution [code example] ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SRP – Problem vs Solution [code example] ,[object Object],[object Object],[object Object],[object Object],[object Object]
SRP – Problem vs Solution [code example] ,[object Object]
SRP – Problem vs Solution [code example] ,[object Object]
SRP – Problem vs Solution [code example] ,[object Object],[object Object]
OCP: Open Closed Principle  ,[object Object]
OCP: Open Closed Principle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OCP: Open Closed Principle ,[object Object],[object Object],Logger BaseLogger Logger DBLogger Logger DBLogger Logger DBLogger DBLogger Logger DBLogger DBLogger Logger DBLogger BaseLogger DBLogger Logger DBLogger Logger BaseLogger DBLogger Logger DBLogger
OCP: Where and when View Business Database System 1
OCP: Where and when View Business Database System 1
OCP: Where and when View Business Database System 1 View Database System 2
OCP: Where and when View Business Database System 1 View Database System 2
OCP: Possible Approach: Public vs Private ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OCP: Possible Approach: Inheritance using Interfaces ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OCP: Possible Approach: Polymorphism ,[object Object],[object Object],[object Object],[object Object],[object Object]
OCP: Code Example – The Logger ,[object Object],[object Object]
OCP: Code Example – The Logger Inheritance using Interfaces ,[object Object]
OCP: Code Example – The Logger Polymorphism ,[object Object],[object Object]
OCP: Code Example – Practicalities ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
OCP: Code Example – Field Validation ,[object Object],[object Object]
[object Object],[object Object],OCP: Code Example – Field Validation
LSP: Liskov Substitution Principle ,[object Object]
LSP: Liskov Substitution Principle ,[object Object]
LSP: Violation 1 ,[object Object],[object Object],[object Object],[object Object]
LSP: Violation 2 ,[object Object]
LSP: Violation 2 ,[object Object]
LSP: Liskov Substitution Principle ,[object Object],[object Object],[object Object],[object Object],[object Object]
ISP: Interface Segregation Principle ,[object Object]
ISP: Interface Segregation Principle ,[object Object],[object Object]
ISP: Example 1 ,[object Object],[object Object],[object Object]
ISP: Example 1 ,[object Object],[object Object]
ISP: Example 2 ,[object Object],[object Object],[object Object]
ISP: Example 2 ,[object Object],[object Object]
DIP: Dependency Inversion Principle   ,[object Object],[object Object]
DIP: Dependency Inversion Principle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DIP: Dependency Inversion Principle ,[object Object],[object Object]
DIP: Dependency Inversion Principle ,[object Object]
DIP: Example 1  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DIP: Example 1 ,[object Object],[object Object],[object Object],[object Object],[object Object]
DIP: Example 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DIP: Example 1 – Adapter Pattern ,[object Object],[object Object],[object Object]
DIP: Example 1 – Strategy Pattern ,[object Object],[object Object]
DIP: Example 1 – Final Solution
DIP: Example 1 – Final Solution ,[object Object],[object Object],[object Object],[object Object]
DIP: Other Example(s) ,[object Object]
S.O.L.I.D – Conclusion (benefits) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
S.O.L.I.D – Conclusion (benefits) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
S.O.L.I.D – Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object]
S.O.L.I.D – Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
Java multi threading
Java multi threadingJava multi threading
Java multi threadingRaja Sekhar
 
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING Uttam Singh
 
The Object Model
The Object Model  The Object Model
The Object Model yndaravind
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programmingAmar Jukuntla
 
Abstraction java
Abstraction javaAbstraction java
Abstraction javaMahinImran
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in JavaSpotle.ai
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And MultithreadingShraddha
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming PrinciplesAndrew Ferlitsch
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread SynchronizationBenj Del Mundo
 

What's hot (20)

Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
PROCEDURAL ORIENTED PROGRAMMING VS OBJECT ORIENTED PROGRAMING
 
The Object Model
The Object Model  The Object Model
The Object Model
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
Inner classes in java
Inner classes in javaInner classes in java
Inner classes in java
 
Abstraction java
Abstraction javaAbstraction java
Abstraction java
 
OOP java
OOP javaOOP java
OOP java
 
Java(Polymorphism)
Java(Polymorphism)Java(Polymorphism)
Java(Polymorphism)
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Methods in java
Methods in javaMethods in java
Methods in java
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming Principles
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
concept of oops
concept of oopsconcept of oops
concept of oops
 

Viewers also liked

Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesDr. Syed Hassan Amin
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Conceptsmj
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisMahesh Bhalerao
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental PrinciplesIntro C# Book
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
power poitnt of oops
power poitnt of oopspower poitnt of oops
power poitnt of oopsDhiraj Kumar
 
bGenius kennissessie_20120510
bGenius kennissessie_20120510bGenius kennissessie_20120510
bGenius kennissessie_20120510bgenius
 
SOLID - Not Just a State of Matter, It's Principles for OO Propriety
SOLID - Not Just a State of Matter, It's Principles for OO ProprietySOLID - Not Just a State of Matter, It's Principles for OO Propriety
SOLID - Not Just a State of Matter, It's Principles for OO ProprietyChris Weldon
 
S.O.L.I.D. Software-Engineering Principles - a must know for developers
S.O.L.I.D. Software-Engineering Principles - a must know for developersS.O.L.I.D. Software-Engineering Principles - a must know for developers
S.O.L.I.D. Software-Engineering Principles - a must know for developersProf. Dr. Roland Petrasch
 
Oop principles a good book
Oop principles a good bookOop principles a good book
Oop principles a good booklahorisher
 
Object Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non StaticObject Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non StaticAbdul Rahman Sherzad
 
Rupicon 2014 solid
Rupicon 2014 solidRupicon 2014 solid
Rupicon 2014 solidrupicon
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented ConceptsAbdalla Mahmoud
 
Beyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO codeBeyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO codeMatthias Noback
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented ConceptD Nayanathara
 
OOD Principles and Patterns
OOD Principles and PatternsOOD Principles and Patterns
OOD Principles and PatternsNguyen Tung
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingHaseeb Rehman
 
Design Pattern lecture 1
Design Pattern lecture 1Design Pattern lecture 1
Design Pattern lecture 1Julie Iskander
 

Viewers also liked (20)

Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design Principles
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Concept
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
power poitnt of oops
power poitnt of oopspower poitnt of oops
power poitnt of oops
 
bGenius kennissessie_20120510
bGenius kennissessie_20120510bGenius kennissessie_20120510
bGenius kennissessie_20120510
 
SOLID - Not Just a State of Matter, It's Principles for OO Propriety
SOLID - Not Just a State of Matter, It's Principles for OO ProprietySOLID - Not Just a State of Matter, It's Principles for OO Propriety
SOLID - Not Just a State of Matter, It's Principles for OO Propriety
 
S.O.L.I.D. Software-Engineering Principles - a must know for developers
S.O.L.I.D. Software-Engineering Principles - a must know for developersS.O.L.I.D. Software-Engineering Principles - a must know for developers
S.O.L.I.D. Software-Engineering Principles - a must know for developers
 
Oop principles a good book
Oop principles a good bookOop principles a good book
Oop principles a good book
 
Object Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non StaticObject Oriented Concept Static vs. Non Static
Object Oriented Concept Static vs. Non Static
 
Rupicon 2014 solid
Rupicon 2014 solidRupicon 2014 solid
Rupicon 2014 solid
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented Concepts
 
Beyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO codeBeyond design patterns and principles - writing good OO code
Beyond design patterns and principles - writing good OO code
 
SOLID Design principles
SOLID Design principlesSOLID Design principles
SOLID Design principles
 
Object Oriented Concept
Object Oriented ConceptObject Oriented Concept
Object Oriented Concept
 
OOD Principles and Patterns
OOD Principles and PatternsOOD Principles and Patterns
OOD Principles and Patterns
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server Computing
 
Design Pattern lecture 1
Design Pattern lecture 1Design Pattern lecture 1
Design Pattern lecture 1
 

Similar to Object Oriented Concepts and Principles

Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desaijinaldesailive
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of ControlShuhab Tariq
 
Design poo my_jug_en_ppt
Design poo my_jug_en_pptDesign poo my_jug_en_ppt
Design poo my_jug_en_pptagnes_crepet
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPTAjay Chimmani
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfHouseMusica
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionKnoldus Inc.
 
principles of object oriented class design
principles of object oriented class designprinciples of object oriented class design
principles of object oriented class designNeetu Mishra
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsBasavaraj Patil
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility PrincipleBADR
 
Object- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkObject- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkESUG
 
Ood and solid principles
Ood and solid principlesOod and solid principles
Ood and solid principlesAvinash Kadam
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9google
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringEyob Lube
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++Mohamed Essam
 
Workshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsWorkshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsVisual Engineering
 

Similar to Object Oriented Concepts and Principles (20)

OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of Control
 
Design poo my_jug_en_ppt
Design poo my_jug_en_pptDesign poo my_jug_en_ppt
Design poo my_jug_en_ppt
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Solid principle
Solid principleSolid principle
Solid principle
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
principles of object oriented class design
principles of object oriented class designprinciples of object oriented class design
principles of object oriented class design
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
Object- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkObject- Relational Persistence in Smalltalk
Object- Relational Persistence in Smalltalk
 
L07 Design Principles
L07 Design PrinciplesL07 Design Principles
L07 Design Principles
 
Ood and solid principles
Ood and solid principlesOod and solid principles
Ood and solid principles
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoring
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++
 
Workshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design PatternsWorkshop 2: JavaScript Design Patterns
Workshop 2: JavaScript Design Patterns
 
Objc
ObjcObjc
Objc
 

Object Oriented Concepts and Principles

  • 1. Smart People · Smart Solutions
  • 2. Object Oriented Design Principles Session 1 – Getting a S.O.L.I.D understanding of the basic principles
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. The Basic Concepts of OO - Polymorphism public void ShowPolyMorphismExample() { DerivedClass B = new DerivedClass(); DoWork( B ); BaseClass A = (BaseClass) B ; DoWork( A ); DerivedClass2 C = new DerivedClass2(); DoWork( C ); } public void DoWork (BaseClass baseClass) { baseClass.DoWork(); } public class DerivedClass2 : BaseClass { public override void DoWork() { } public override int WorkProperty { get { return 0; } } } public class DerivedClass : BaseClass { public override void DoWork() { } public override int WorkProperty { get { return 0; } } } public class BaseClass { public virtual void DoWork() { } public virtual int WorkProperty { get { return 0; } } }
  • 10.
  • 11. The Basic Concepts of OO - Getting a S.O.L.I.D understanding of the basic principles
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. OCP: Where and when View Business Database System 1
  • 29. OCP: Where and when View Business Database System 1
  • 30. OCP: Where and when View Business Database System 1 View Database System 2
  • 31. OCP: Where and when View Business Database System 1 View Database System 2
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. DIP: Example 1 – Final Solution
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.