SlideShare a Scribd company logo
Seminar 2 : The state of the practice Programming Paradigms [The Paradigms - Group 2]
Most of us will be in I.T Industry 2
Being experts in a paradigmcan help us climb up the corporate ladder 3
Object-Oriented  Paradigm 4
Everyone knows how to use Object-Oriented Programming Languages 5 Objective-c Java Javascript C# PHP C++ Python
But does knowing OO programming languagesequivalent to knowing OO paradigm? 6
Let us be Experts in OO Paradigm And overcome its limitations 7
Quest: Mastery of OO
9 Training : OO Characteristics
Let’s Recap:What is Object-Oriented Paradigm? 10
Recap 11 View everything as objects which Behaviors Properties Human “Alice” Name: Gender: Size: Eye _colour: Shopping() Animal Building “Bob”
12 OO Characteristics? You know that… But have you misunderstood any of these concepts?
13 Weak OO Model Scenario: Looking for an item in Challenger
14 Weak OO Model Straight OO Modeling
15 Training : OO Characteristics
Characteristics of OO Abstraction: A high level view Eliminate the Irrelevant, Amplify the Essential
Characteristics of OO The Vet Point of View ,[object Object]
Parts of the cat
Etc…
 Irrelevant
Favorite Toy
Etc… ,[object Object]
Favorite Toy
Etc…
 Irrelevant
Scientific Names of the cat’s body parts
Etc… ,[object Object]
Characteristics of OO Encapsulation Hiding the Unnecessary
Characteristics of OO Programming Point of View Student Student + StudentID + CAP - StudentID - CAP  Private  Public
Main Concepts of OO Programming Point of View ,[object Object]
Bypass checking
Breach integrity
Break in code when there is change
Vulnerable to malicious attackStudent + StudentID + CAP Public
23 Characteristics of OO They might look the similar, but they are not. Father Son Modeling the Similarity
Characteristics of OO Programming Point of View Student Professor name gender address phoneNumber matricNo name gender address phoneNumber staffID driveVehicle() driveVehicle()
Characteristics of OO Student Professor name gender address phoneNumber matrixNo name gender address phoneNumber staffID driveVehicle() driveVehicle() A Better Solution
Characteristics of OO Inheritance is used to express“is a” relationship. Student Professor Person Base Class (Generalization) matricNo staffID name gender address … … driveVehicle() Derived Class (Specialization)
27 Characteristics of OO If you ask different animal to “speak”, they responds in their own way. Same Function Different Behavior

More Related Content

What's hot

Overview of programming paradigms
Overview of programming paradigmsOverview of programming paradigms
Overview of programming paradigms
David-Frelin Johnson
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming ParadigmsJaneve George
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
Anirudh Chauhan
 
Programming Languages
Programming LanguagesProgramming Languages
Programming Languages
Edward Blurock
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
busyking03
 
Paradigms
ParadigmsParadigms
Paradigms
Edward Blurock
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
Haris Bin Zahid
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
Anbarasan Gangadaran
 
C++ OOP Implementation
C++ OOP ImplementationC++ OOP Implementation
C++ OOP ImplementationFridz Felisco
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
Ankit92Chitnavis
 
Presentation c
Presentation cPresentation c
Presentation c
Kunal Sharma
 
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
Simplilearn
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Asfand Hassan
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
Durgesh Singh
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
Ahmed Gad
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
Schwannden Kuo
 
Chapter 1
Chapter 1Chapter 1
PL Lecture 02 - Binding and Scope
PL Lecture 02 - Binding and ScopePL Lecture 02 - Binding and Scope
PL Lecture 02 - Binding and Scope
Schwannden Kuo
 
object oriented programming(oops)
object oriented programming(oops)object oriented programming(oops)
object oriented programming(oops)
HANISHTHARWANI21BCE1
 

What's hot (20)

Overview of programming paradigms
Overview of programming paradigmsOverview of programming paradigms
Overview of programming paradigms
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
 
Programming Languages
Programming LanguagesProgramming Languages
Programming Languages
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 
Paradigms
ParadigmsParadigms
Paradigms
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
C++ OOP Implementation
C++ OOP ImplementationC++ OOP Implementation
C++ OOP Implementation
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
Presentation c
Presentation cPresentation c
Presentation c
 
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
 
Presentation
PresentationPresentation
Presentation
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
PL Lecture 02 - Binding and Scope
PL Lecture 02 - Binding and ScopePL Lecture 02 - Binding and Scope
PL Lecture 02 - Binding and Scope
 
object oriented programming(oops)
object oriented programming(oops)object oriented programming(oops)
object oriented programming(oops)
 

Viewers also liked

Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?
Netguru
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
Edward Blurock
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
Bhavin Kamani
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
Mohammad Kamrul Hasan
 
Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)
Calvin Cheng
 
Generations Of Programming Languages
Generations Of Programming LanguagesGenerations Of Programming Languages
Generations Of Programming Languages
py7rjs
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
Gaditek
 
Chapter 13 programming languages and program development
Chapter 13   programming languages and program developmentChapter 13   programming languages and program development
Chapter 13 programming languages and program development
haider ali
 
Software Engineering - chp1- software dev methodologies
Software Engineering - chp1- software dev methodologiesSoftware Engineering - chp1- software dev methodologies
Software Engineering - chp1- software dev methodologies
Lilia Sfaxi
 
Principles Of Programing Languages
Principles Of Programing LanguagesPrinciples Of Programing Languages
Principles Of Programing Languages
Matthew McCullough
 
Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \
Pritom Chaki
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In Java
Andrei Solntsev
 
Software Engineering - chp6- development phase
Software Engineering - chp6- development phaseSoftware Engineering - chp6- development phase
Software Engineering - chp6- development phase
Lilia Sfaxi
 
Software Engineering - chp8- deployment
Software Engineering - chp8- deploymentSoftware Engineering - chp8- deployment
Software Engineering - chp8- deployment
Lilia Sfaxi
 
Cátalogo Baltic Wood
Cátalogo Baltic WoodCátalogo Baltic Wood
Cátalogo Baltic Wood
Gibeller
 
Media Technologies
Media TechnologiesMedia Technologies
Media Technologiessarahlambe
 
Pelan lokasi bengkel serunding daging for merge
Pelan lokasi bengkel serunding daging   for mergePelan lokasi bengkel serunding daging   for merge
Pelan lokasi bengkel serunding daging for merge
nahhaswide
 
Wh3
Wh3Wh3
Wh3
ottolio
 

Viewers also liked (19)

Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
 
Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)
 
Generations Of Programming Languages
Generations Of Programming LanguagesGenerations Of Programming Languages
Generations Of Programming Languages
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Chapter 13 programming languages and program development
Chapter 13   programming languages and program developmentChapter 13   programming languages and program development
Chapter 13 programming languages and program development
 
Software Engineering - chp1- software dev methodologies
Software Engineering - chp1- software dev methodologiesSoftware Engineering - chp1- software dev methodologies
Software Engineering - chp1- software dev methodologies
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Principles Of Programing Languages
Principles Of Programing LanguagesPrinciples Of Programing Languages
Principles Of Programing Languages
 
Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \Object Orinted Programing(OOP) concepts \
Object Orinted Programing(OOP) concepts \
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In Java
 
Software Engineering - chp6- development phase
Software Engineering - chp6- development phaseSoftware Engineering - chp6- development phase
Software Engineering - chp6- development phase
 
Software Engineering - chp8- deployment
Software Engineering - chp8- deploymentSoftware Engineering - chp8- deployment
Software Engineering - chp8- deployment
 
Cátalogo Baltic Wood
Cátalogo Baltic WoodCátalogo Baltic Wood
Cátalogo Baltic Wood
 
Media Technologies
Media TechnologiesMedia Technologies
Media Technologies
 
Pelan lokasi bengkel serunding daging for merge
Pelan lokasi bengkel serunding daging   for mergePelan lokasi bengkel serunding daging   for merge
Pelan lokasi bengkel serunding daging for merge
 
Wh3
Wh3Wh3
Wh3
 

Similar to Programming Paradigms Seminar 2

M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
RojaPogul1
 
OOP programming
OOP programmingOOP programming
OOP programminganhdbh
 
Introduction of object oriented analysis & design by sarmad baloch
Introduction of object oriented analysis & design by sarmad balochIntroduction of object oriented analysis & design by sarmad baloch
Introduction of object oriented analysis & design by sarmad baloch
Sarmad Baloch
 
09 grasp
09 grasp09 grasp
Intro tooop
Intro tooopIntro tooop
Intro tooop
Parameshwar Maddela
 
Using binary classifiers
Using binary classifiersUsing binary classifiers
Using binary classifiersbutest
 
M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
RAJESH S
 
OOPS
OOPSOOPS
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaBoost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Stack Learner
 
Object-Oriented Programming in Java (Module 1)
Object-Oriented Programming in Java (Module 1)Object-Oriented Programming in Java (Module 1)
Object-Oriented Programming in Java (Module 1)
muhammadmubinmacadad2
 
香港六合彩 » SlideShare
香港六合彩 » SlideShare香港六合彩 » SlideShare
香港六合彩 » SlideShare
biyu
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best Practices
Supun Dissanayake
 
OO and Rails...
OO and Rails... OO and Rails...
OO and Rails... adzdavies
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptx
AbhilashTom4
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
Randy Connolly
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
Scott Wlaschin
 
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
Session 07 - Intro to Object Oriented Programming with Java
Session 07 - Intro to Object Oriented Programming with JavaSession 07 - Intro to Object Oriented Programming with Java
Session 07 - Intro to Object Oriented Programming with Java
PawanMM
 
Intro to Object Oriented Programming with Java
Intro to Object Oriented Programming with Java Intro to Object Oriented Programming with Java
Intro to Object Oriented Programming with Java
Hitesh-Java
 

Similar to Programming Paradigms Seminar 2 (20)

M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
 
OOP programming
OOP programmingOOP programming
OOP programming
 
Introduction of object oriented analysis & design by sarmad baloch
Introduction of object oriented analysis & design by sarmad balochIntroduction of object oriented analysis & design by sarmad baloch
Introduction of object oriented analysis & design by sarmad baloch
 
09 grasp
09 grasp09 grasp
09 grasp
 
Intro tooop
Intro tooopIntro tooop
Intro tooop
 
Using binary classifiers
Using binary classifiersUsing binary classifiers
Using binary classifiers
 
M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
 
OOPS
OOPSOOPS
OOPS
 
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaBoost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In Bangla
 
Object-Oriented Programming in Java (Module 1)
Object-Oriented Programming in Java (Module 1)Object-Oriented Programming in Java (Module 1)
Object-Oriented Programming in Java (Module 1)
 
Ooad Uml
Ooad UmlOoad Uml
Ooad Uml
 
香港六合彩 » SlideShare
香港六合彩 » SlideShare香港六合彩 » SlideShare
香港六合彩 » SlideShare
 
Creativity vs Best Practices
Creativity vs Best PracticesCreativity vs Best Practices
Creativity vs Best Practices
 
OO and Rails...
OO and Rails... OO and Rails...
OO and Rails...
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptx
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
 
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
 
Session 07 - Intro to Object Oriented Programming with Java
Session 07 - Intro to Object Oriented Programming with JavaSession 07 - Intro to Object Oriented Programming with Java
Session 07 - Intro to Object Oriented Programming with Java
 
Intro to Object Oriented Programming with Java
Intro to Object Oriented Programming with Java Intro to Object Oriented Programming with Java
Intro to Object Oriented Programming with Java
 

Programming Paradigms Seminar 2

Editor's Notes

  1. As we are famillar with OO
  2. An OO paradigm view everything in this world as objects. Like on Earth, we have objects of human, animal and building.
  3. Deals with what a class know or does… it includes the responsibilities, attributes and methodsThe Vet see the different part of the cats in terms of structure things like what it likes to do or likes to eat does not matterThe old lady see the cat as her pet will more likely be interested in what the cat like to eat but not the different parts of the cat body
  4. Deals with what a class know or does… it includes the responsibilities, attributes and methodsThe Vet see the different part of the cats in terms of structure things like what it likes to do or likes to eat does not matterThe old lady see the cat as her pet will more likely be interested in what the cat like to eat but not the different parts of the cat body
  5. Deals with what a class know or does… it includes the responsibilities, attributes and methodsThe Vet see the different part of the cats in terms of structure things like what it likes to do or likes to eat does not matterThe old lady see the cat as her pet will more likely be interested in what the cat like to eat but not the different parts of the cat body
  6. Programming Example-> Keypad -> Example contain alphabet, numeric, operator, function-> NUMPAD -> ATM need only number only there for only takes in Numeric
  7. Abstraction tells us that we need this function for the object. Encapsulation deals with how you intend to modularize the features. It deals with how the functions is being compartmentalize. It like a black box what is being done is not known to the rest of the system
  8. PublicPrivate
  9. Public attributes like studentID and telNum can be edited directly. However the will be
  10. Inheritance [XT]A mechanism that reuse existing code and extend to new classesGiven this 2 classes, they have similar properties between them.No doubt, we can develop both classes independently can get them running (probably can just create a student class first, then copy the code and modify a bit for the creation of Professor class)However, if u made an error on driveVehicle method, got to modify code on both sideCan only inherit protect and public attributes and methods but not private ones. A subclass does not inherit the private members of its parent class. However, if the superclass has public or protected methods for accessing its private fields, these can also be used by the subclass.
  11. Inheritance [XT]A mechanism that reuse existing code and extend to new classesGiven this 2 classes, they have similar properties between them.No doubt, we can develop both classes independently can get them running (probably can just create a student class first, then copy the code and modify a bit for the creation of Professor class)However, if u made an error on driveVehicle method, got to modify code on both sideCan only inherit protect and public attributes and methods but not private ones. A subclass does not inherit the private members of its parent class. However, if the superclass has public or protected methods for accessing its private fields, these can also be used by the subclass.
  12. Inheritance Approach:Encapsulate the similar properties into another class “Person” can let “Student” class and “Professor” extends from it.Student “is a” person. Professor “is a” person.All the properties and behaviors of the base class Person, are inherited.Base Class: Person, Derived Class: Student, ProfessorAnother way to look at this UML is Student and professor is a specialization of Person ClassAnd Person class is a generalization of student class or professor class.
  13. method
  14. Each job profession in a company have different salaries (each have their own calculation of pay per month, per year etc).If you want to call the computeSalary() of a CEO, you would have to specifically call from each individual class:
  15. With polymorphism, each classes are treated the same way.The programmer no need to be concerned about the precise type of the class but just to call the method work() on a generalized class. The OO system will then determine its class type at runtime, and invoke the correct work() accordingly.
  16. Generalize the 3 classes into one abstract class, containing the abstract method work().Since person is the base class, the variable object of type person and be store with type engineer, accountant and professor subsequently.Programmer does not have to know exact class type when coding. It will be determined at run-time.
  17. When we have a list that contains different objects of different professions, we can loop through the list and call the work method directly without the need to check the type of the object. At run-time, the object will be connected to the appropriated method and this is known as dynamic bindingSignificantly reduces the development effort.
  18. Store derived class in base class and call the common method. At runtime, the system will locate the actual implementation of method at corresponding class.computeDiscount method is used to calculate the percentage of discount for each item given a promotional event e.g. Great Singapore Sales, year end sales.The discount can be of storewide discount => method in ItemThe discount can be of different type discount, e.g. 10% for all hardwares => the method in the hardware class overrides the computeDiscount at ItemThe discount can be of same type but different kind, e.g. 10% for all software only=> the method in the Software class overrides the computeDiscount at Multimedia.