SlideShare a Scribd company logo
1 of 42
By:
Altaf Hussain
SS KRL
BS(CS), AU Peshawar, MS(CSE), NUST Islamabad
 Understand the basic principles of object orientation
 Understand the basic concepts and terms of object
 Basic Principles of Object Orientation
 Basic Concepts of Object Orientation
Object Orientation
Encapsulation
Abstraction
Hierarchy
Modularity
5
 Abstraction allows us to manage complexity by
concentrating on essential aspects making an entity
different from others.
 A process allowing to focus on most important aspects
while ignoring less important details.
Salesperson
Not saying Which
salesperson – just
a salesperson in
general!!!
Customer
Product
Manages Complexity
 Hide implementation from clients
• Clients depend on interface
How does an object encapsulate?
What does it encapsulate?
 The breaking up of something complex into
manageable pieces
Order Processing
System
Order Entry
Order Fulfillment
Billing
Decreasing
abstraction
Increasing
abstraction
Asset
RealEstate
Savings
BankAccount
Checking Stock
Security
Bond
Elements at the same level of the hierarchy
should be at the same level of abstraction
 Levels of abstraction – ordering of abstraction in a tree
like structure
 Basic Principles of Object Orientation
 Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface
 Implementation
 Association
 Aggregation
 Composition
 Generalization
 Super-Class
 Sub-Class
 Abstract Class
 Concrete Class
 Discriminator
 Polymorphism
Truck
Chemical Process
Linked List
 Informally, an object represents an entity, either
physical, conceptual, or software
• Physical entity
• Conceptual entity
• Software entity
 An object is a concept, abstraction, or thing with sharp
boundaries and meaning for an application
 An object is something that has:
• State
• Behavior
• Identity
14
 Object-oriented programming supports the view that
programs are composed of objects that interact with
one another.
 How would you describe an object?
 Using its characteristics (has a ----?) and its behaviors
(can do ----?)
 Object must have unique identity (name) : Basketball,
Blue ball
 Consider a ball:
• Color and diameter are characteristics (Data
Declarations)
• throw, bounce, roll are behaviors (Methods)
15
 A class defines the general nature of a collection of
objects of the same type.
 The process creating an object from a class is called
instantiation.
 Every object is an instance of a particular class.
 There can be many instances of objects from the same
class possible with different values for data.
Objects Example
16
class Rose
blueRose
redRose
class
objects
Object
References
OO Principle: Abstraction
 A class is a description of a group of objects with
common properties (attributes), behavior (operations),
relationships, and semantics
• An object is an instance of a class
 A class is an abstraction in that it:
• Emphasizes relevant characteristics
• Suppresses other characteristics
a + b = 10
Class
Course
Properties
Name
Location
Days offered
Credit hours
Start time
End time
Behavior
Add a student
Delete a student
Get course roster
Determine if it is full
Professor
name
empID
create( )
save( )
delete( )
change( )
Class Name
Attributes
Operations
 A class is comprised of three sections
• The first section contains the class name
• The second section shows the structure (attributes)
• The third section shows the behavior (operations)
 How many classes do you see?
Objects Class
Professor Smith
Professor Jones
Professor Mellon
Professor
 A class is an abstract definition of an object
• It defines the structure and behavior of each object in the class
• It serves as a template for creating objects
 Objects are grouped into classes
:CourseOffering
number = 101
startTime = 900
endTime = 1100
:CourseOffering
number = 104
startTime = 1300
endTime = 1500
CourseOffering
number
startTime
endTime
Class
Attribute
Object
Attribute Value
CourseOffering
addStudent
deleteStudent
getStartTime
getEndTime
Class
Operation
24
 A class that lacks a complete implementation and
provides operations without implementing some methods
 Cannot be used to create objects; cannot be instantiated
 A concrete sub-class must provide methods for
unimplemented operations
25
 Has methods for all operations
 Can be instantiated
 Methods may be:
a) defined in the class or
b) inherited from a super-class
26
 Discriminator – an attribute that defines sub-classes
 Example: “status” of company staff is a possible
discriminator to derive “management”, “senior” and
“junior” sub-classes.
27
 Ability to dynamically choose the method for an
operation at run-time or service-time
 facilitated by encapsulation and generalization:
• encapsulation – separation of interface from
implementation
• generalization –organizing information such that
the shared features reside in one class and
unique features in another
 Operations could be defined and implemented in the
super-class, but re-implemented methods are in unique
sub-classes.
Manufacturer A
Manufacturer B
Manufacturer C
OO Principle:
Encapsulation
 The ability to hide many different implementations
behind a single interface
Tube
Pyramid
Cube
Shape
Draw
Move
Scale
Rotate
<<interface>>
Realization relationship (stay tuned for realization relationships)
 Interfaces formalize polymorphism
 Interfaces support “plug-and-play” architectures
 Association
• Aggregation
• Composition
 Dependency
 Generalization
 Realization
Professor UniversityWorks for
Class
Association
Association Name
Professor University
EmployerEmployee
Role Names
 Models a semantic connection among classes
Student Schedule
Whole
Aggregation
Part
 A special form of association that models a whole-part
relationship between an aggregate (the whole) and its
parts
Student Schedule
Whole
Aggregation
Part
 A form of aggregation with strong ownership and
coincident lifetimes
• The parts cannot survive the whole/aggregate a
 Multiplicity defines how many objects participate in a
relationships
• The number of instances of one class related to ONE
instance of the other class
• Specified for each end of the association
 Associations and aggregations are bi-directional by
default, but it is often desirable to restrict navigation to
one direction
• If navigation is restricted, an arrowhead is added to
indicate the direction of the navigation
Student Schedule1 0..*
Multiplicity
Navigation
Client Supplier
Package
ClientPackage SupplierPackage
Client Supplier
Class
Dependency
relationship
Dependency
relationship
Component
 A relationship between two model elements where a
change in one may cause a change in the other
 Non-structural,“using” relationship
 A relationship among classes where one class shares
the structure and/or behavior of one or more classes
 Defines a hierarchy of abstractions in which a subclass
inherits from one or more super-classes
• Single inheritance
• Multiple inheritance
 Generalization is an “is-a-kind of” relationship
Account
balance
name
number
Withdraw()
CreateStatement()
Checking
Withdraw()
Savings
GetInterest()
Withdraw()
Superclass
(parent)
Subclasses
Generalization
Relationship
Ancestor
Descendents
 One class inherits from another
Airplane Helicopter Wolf Horse
FlyingThing Animal
Bird
multiple
inheritance
Use multiple inheritance only when needed, and
always with caution !
 A class can inherit from several other classes
Inheritance leverages the similarities among classes
 A subclass inherits its parent’s attributes,
operations, and relationships
 A subclass may:
• Add additional attributes, operations, relationships
• Redefine inherited operations (use caution!)
 Common attributes, operations, and/or
relationships are shown at the highest
applicable level in the hierarchy
Truck
tonnage
GroundVehicle
weight
licenseNumber
Car
owner
register( )
getTax( )
Person
0..*
Trailer
1
Superclass
(parent)
Subclass
generalization
size
Component
Interface
Use Case Use-Case Realization
Elided form
Class
Interface
Subsystem
Interface
Canonical form
 One classifier serves as the contract that the other classifier
agrees to carry out
 Found between:
• Interfaces and the classifiers that realize them
• Use cases and the collaborations that realize them

More Related Content

What's hot

The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship modelJane Garay
 
SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object OrientationMichael Heron
 
Ooad notes
Ooad notesOoad notes
Ooad notesNancyJP
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systemsTaher Barodawala
 
Object oriented database model
Object oriented database modelObject oriented database model
Object oriented database modelPAQUIAAIZEL
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UMLyndaravind
 
Ch 5 O O Data Modeling Class
Ch 5  O O  Data Modeling ClassCh 5  O O  Data Modeling Class
Ch 5 O O Data Modeling Classguest8fdbdd
 
Ijarcet vol-2-issue-4-1363-1367
Ijarcet vol-2-issue-4-1363-1367Ijarcet vol-2-issue-4-1363-1367
Ijarcet vol-2-issue-4-1363-1367Editor IJARCET
 
Chapter # 12 er modeling
Chapter # 12 er modelingChapter # 12 er modeling
Chapter # 12 er modelingNazir Ahmed
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
L ab # 07
L ab # 07L ab # 07
L ab # 07Mr SMAK
 

What's hot (20)

ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object Orientation
 
Chapter3
Chapter3Chapter3
Chapter3
 
Ooad notes
Ooad notesOoad notes
Ooad notes
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systems
 
Object oriented database model
Object oriented database modelObject oriented database model
Object oriented database model
 
Ooad ch 4
Ooad ch 4Ooad ch 4
Ooad ch 4
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
 
Ch 5 O O Data Modeling Class
Ch 5  O O  Data Modeling ClassCh 5  O O  Data Modeling Class
Ch 5 O O Data Modeling Class
 
Ooad ch 3
Ooad ch 3Ooad ch 3
Ooad ch 3
 
Ijarcet vol-2-issue-4-1363-1367
Ijarcet vol-2-issue-4-1363-1367Ijarcet vol-2-issue-4-1363-1367
Ijarcet vol-2-issue-4-1363-1367
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
Chapter # 12 er modeling
Chapter # 12 er modelingChapter # 12 er modeling
Chapter # 12 er modeling
 
Relational Model
Relational ModelRelational Model
Relational Model
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
L ab # 07
L ab # 07L ab # 07
L ab # 07
 

Similar to Lecture#01, object orientation

OOAD notes.pptx
OOAD notes.pptxOOAD notes.pptx
OOAD notes.pptxRAJESH S
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented DesignAravinth NSP
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindiappsdevelopment
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapVikas Jagtap
 
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas18130208
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_conceptAmit Gupta
 
8 oo approach&uml-23_feb
8 oo approach&uml-23_feb8 oo approach&uml-23_feb
8 oo approach&uml-23_febRaj Shah
 
Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)Ahmad karawash
 
Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Ganapathi M
 

Similar to Lecture#01, object orientation (20)

OOAD notes.pptx
OOAD notes.pptxOOAD notes.pptx
OOAD notes.pptx
 
OOAD.pptx
OOAD.pptxOOAD.pptx
OOAD.pptx
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
OOP Presentation.pptx
OOP Presentation.pptxOOP Presentation.pptx
OOP Presentation.pptx
 
OOP Presentation.pptx
OOP Presentation.pptxOOP Presentation.pptx
OOP Presentation.pptx
 
OOPs in Java
OOPs in JavaOOPs in Java
OOPs in Java
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
 
Oot
OotOot
Oot
 
Unit 3
Unit 3Unit 3
Unit 3
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_concept
 
8 oo approach&uml-23_feb
8 oo approach&uml-23_feb8 oo approach&uml-23_feb
8 oo approach&uml-23_feb
 
Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)
 
Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0
 
CS8592-OOAD Lecture Notes Unit-2
CS8592-OOAD Lecture Notes Unit-2CS8592-OOAD Lecture Notes Unit-2
CS8592-OOAD Lecture Notes Unit-2
 

More from babak danyal

Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Socketsbabak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the desbabak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systemsbabak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systemsbabak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systemsbabak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systemsbabak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systemsbabak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systemsbabak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systemsbabak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systemsbabak danyal
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signababak danyal
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systemsbabak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 

More from babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Lecture#01, object orientation

Editor's Notes

  1. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation In the Best Practices module, we discussed some characteristics common to successful projects. OO facilitates the following best practices: Develop Iteratively Model Visually Use Component Architecture Defining basic OO terms and concepts allows everyone in the class to start on a level playing field.
  2. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  3. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  4. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Discuss what makes a good abstraction with the students: Concise, Represents a single coherent concept, etc.
  5. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Encapsulation is putting the “databits” and operations that manipulate them in the same place. Encapsulation DISALLOWS direct manipulation of things that have been encapsulated without utilising the supplied interface. Another example - the accelerator on a car. You put your foot down and car goes faster - this works on most cars, and you don’t worry about the cables, electronics, engine, etc.
  6. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Before moving on, ask the students to name the four basic principles of OO (as a review).
  7. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  8. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  9. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation A class has been called a “cookie cutter” for objects.
  10. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  11. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation In Rose: You may select which compartments are displayed via Diagram Object Properties for the diagram element. You may select which items appear in which compartments using the Edit Compartment function for the diagram element.
  12. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation The answers you get will vary depending on the students’ perspectives on what they see, as well as the criteria they use to organize the objects shown on this slide. For example, some possible answers include: Two classes: animals and non-animals Two classes: Extinct and non-extinct things Etc.
  13. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation This may seem repetitive with earlier slides, but it has been noted that the repetition of the discrimination between objects and classes is beneficial to “newbies”. If this does not apply to your class, you can cover this slide briefly.
  14. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  15. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  16. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Polymorphism will be addressed in more detail in the Class Design module. Another example of polymorphism: There is a toddler sitting in front of some blocks and a teenager siting in front of a piano. An adult walks into the room and says “play”. The toddler plays with the blocks and the teenage plays the piano. Another example - car accelerator on different cars.
  17. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Interfaces are not abstract classes, as abstract classes allow you to provide default behavior for some/all of their methods. Interfaces provide no default behavior.
  18. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Don’t cover the details of the graphic on this slide. The semantics of each of the relationships will be discussed later.
  19. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Associations connect instances of two or more classes together for some duration (as opposed to a dependency relationship, which represents a temporary association between two instances). Dependency relationships will be discussed in the Class Design module. Do not use relationship/role names if they add no value/information to the model. Remember, readability and understandability of the model are key -- only add information that adds value, not clutter to the diagrams.
  20. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation There are many examples of whole-part relationships: a Library contains Books, within a company Departments are made-up of Employees, a Computer is composed of a number of Devices. However, whether you model a relationship as an association or aggregation is really dependent on the domain being modeled. This is discussed in more detail on a later slide.
  21. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Explain to the students that the diamond on this slide must be filled in with black so that the books would print right. If it was filled in with white, it would not be filled in in the books. Note: Compositional aggregation can be shown in by nesting one class within another; however, Rose does not directly support the drawing of a class within a class. Composition is not equivalent to containment by value, as some languages do not support containment by value (e.g., Java). By-value vs. by-reference is an implementation “thing”, whereas composition is a conceptual “thing” that can realized in the implementation using by-value, or by-reference (if the distinction is supported). Note: In Rose, composition is modeled by specifying “by-value” for the containment property of a role of a relationship.
  22. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  23. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  24. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  25. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Generalization relationships are also permitted between packages. However, since packages do not themselves have any semantics, generalization between packages is not very common (generalization amongst subsystems, however, is practical). According to Grady Booch: “The terms “inheritance” and “generalization” are, practically speaking, interchangeable. The UML standardized on calling the relationship “generalization” so as not to confuse people with language-specific meanings of inheritance. To confuse matters further, some call this an “is-a” or a “kind of” relationship (especially those into conceptual modeling in the cognitive sciences). So, for most users, it’s fair to use either term. For power users - people who care about things like the UML metamodel and specifying formal semantics of the same, the relationship is called “generalization” and applying such a relationship between, for example, two classes, results in the subclass inheriting the structure and operations of the superclass (i.e. inheritance is the mechanism).
  26. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  27. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation
  28. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Emphasize that when a change is made to a super class all descendent classes inherit the change. Some languages do not support generalization. In these cases you will need to update the design model to reflect the characteristics of the implementation language. In cases where the implementation language does not support generalization between classes you must “design generalization in”. See the language specific appendices for more information. See Class Design for more information.
  29. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation Ask the class the following to test their understanding: “ Without looking at your notes: How many operations does Car have? Answer: 1 How may relationships? Answer: 1 How many operations does Truck have? Answer: 2 How may relationships? Answer: 2” Generalization provides a way to implement polymorphism in cases where polymorphism is implemented the same way for a set of classes. The use of generalization to support polymorphism is discussed in more detail in the Class Design module
  30. OOADv4.2 Instructor Notes Module 3 - Introduction to Object Orientation We discussed subsystems earlier in this module. We will look at interfaces and the realization relationship in more detail in the Architectural Design module.