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

1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop pptdaxesh chauhan
 
Inheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingInheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingAshita Agrawal
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming languageMd.Al-imran Roton
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)MD Sulaiman
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMSkoolkampus
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming PrinciplesAndrew Ferlitsch
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member FunctionsMuhammad Hammad Waseem
 

What's hot (20)

Oop
OopOop
Oop
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
 
Inheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingInheritance in Object Oriented Programming
Inheritance in Object Oriented Programming
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
Java(Polymorphism)
Java(Polymorphism)Java(Polymorphism)
Java(Polymorphism)
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
4.2 PHP Function
4.2 PHP Function4.2 PHP Function
4.2 PHP Function
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
Object Oriented Programming Principles
Object Oriented Programming PrinciplesObject Oriented Programming Principles
Object Oriented Programming Principles
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Oop Presentation
Oop PresentationOop Presentation
Oop Presentation
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
 

Viewers also liked

Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
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
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
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
 

Viewers also liked (20)

Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering 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
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
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
 

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.