SlideShare a Scribd company logo
Object Oriented Analysis & Design (OOAD)
Unit-I
Chapter – 2
Object Basics
2.1 Introduction
• Understand Object by an example
• Car  Object ( Real World Entity)
• Properties
• Methods
What is object orientation?
• Object Oriented (OO) means that we organize software
as a collection of discrete objects that incorporate both
data structure & behavior.
• OO approach its generally include four aspects:
1. Identity
2. Classification
3. Inheritance
4. Polymorphism
• Identity means that data is quantized into discrete,
distinguishable entities called objects.
• Each object has its own inherent identity.
• In other words, two objects are distinct even if all their
attributes values (such as name and size) are identical.
• The white queen in a chess game for example of
objects.
Identity
Objects can be:
• External Entity (e.g., other systems, devices, people)
that produce or consume information to be used by
system
• Things (e.g., reports, displays, letters, signals) that are
part of information domain for the problem
• Places (e.g., book’s room) that establish the context of
the problem and the overall function of the system.
• Organizational units (e.g., division, group, team,
department) that are relevant to an application,
• Transaction (e.g., loan, take course, buy, order).
How to identify object?
6
Object Identity Behaviors State
An employee “Mr. John” Join(),
Retire()
Joined,
Retired.
A book “Book with title
Object Oriented
Analysis Design”
Add Exemplar, Rent,
available,
reserved
A sale “Sale no 0015,
15/12/98”
SendInvoiced(),
Cancel().
Invoiced,
cancelled.
Object
What is classification?
• Classification means that objects with the same data
structure (attributes) and behavior (operations) are
grouped into a class.
• For example Paragraph, Monitor & Chess Piece.
• Class is a collection of objects.
• A Class is an abstraction that describes properties
important to an application and ignores the rest.
• Any choice of classes is arbitrary and depends on the
applications.
• For example,
Fruit mango, apple, banana…etc.
Classification
• Each Class describes a possibly infinite set of individual
objects.
• Each object is said to be an instance of its class.
• An object has its own value for each attribute but
shares the attribute names and operations with other
instances of the class.
What is Inheritance?
3. Inheritance :
• Inheritance is the process, in which one object can use the properties
of another object.
• It allows the declaration and implementation of one class to based an
existing class.
• The concept of inheritance provides the idea of reusability..
Parent Base or Super class
Child Derived or Sub class
Parent +
Child
features
Parent
features
Inheritance
• Inheritance is the sharing of attributes and operations
(features) among classes based on a hierarchical
relationship.
• A Super class has general information that subclasses
refine and elaborate.
• Each subclass incorporates, or inherits, all the features
of its super class and adds its own unique features.
• Subclasses need not repeat the features of the super
class.
• For example, Scrolling Window and Fixed Window are
subclasses of Window.
Inheritance
• Both subclasses inherit the features of Window, such as
a visible region on the screen.
• Scrolling Window adds a scroll bar and an offset.
• The ability to factor out common features of several
classes into a super class can greatly reduce repetition
within designs and programs and is one of the main
advantages of OO technology.
Bird
Flying Bird Non Flying Bird
What is Polymorphism?
• Polymorphism means the ability to take more than one
form.
• It allows a single name to be used for more than one
related purpose.
• It can be also defined as the property that allows an
operation to have different behavior on different objects.
Shape
SquareCircle
name
getName( )
calculateArea( )
side
calculateArea( )
radius
calculateArea( )
What is Polymorphism?
• An operations is a procedure or transformation that an
object perform is subject to.
• For example ,
Polygon objects ---------- Polygon class
Attributes
-vertices
-border color
-fill color
Operations
-draw
-erase
-move
Polymorphism
• An implementation of an operation by a specific class is
called a method.
• Because an OO operator is polymorphic, it may have more
than one method implementing it, each for a different
class of object.
Abstraction
• Abstraction is the selective examination of certain
aspects of a problem.
• Creating new data types using encapsulated items is
known as data abstraction.
• It is also the process of grouping the attributes and
functions to operate these attributes.
• And the data type created by the data abstraction are
known as Abstract Data Types (ADT).
• Attributes : is known as data members.
Abstraction
• Abstraction is the presentation of simple concept (or
object) to the external world.
• Abstraction concept is to describe a set of similar
concrete entities.
• It focuses on the essential, inherent aspects of an entity
and ignoring its accidental properties.
• The abstraction concept is usually used during analysis:
deciding only with application-domain concepts, not
making design and implementation decisions.
Abstraction
• Two popular abstractions: procedure abstraction and
data abstraction.
• Procedure abstraction is to decompose problem to many
simple sub-works.
• Data abstraction is to collect essential elements
composing to a compound data.
• These two abstractions have the same objective:
reusable and replaceable.
Abstraction
• Below figure shows an example of data abstraction to
abstract doors as a data structure with essential
properties.
• Example of Data Abstraction.
Three Models
• We use three kinds of models to describe a system
from different viewpoints:
1. Class Model
2. State Model
3. Interaction Model
• Class Model: For the objects in the system & their
relationships.
• State Model: For the life history of objects.
• Interaction Model: For the interactions among objects.
Class Model
1. Class Model:
• For the objects in the system & their relationships.
• The class model defines the context for software development –
the universe of discourse.
• The class model contains class diagrams.
• A class diagram is a graph whose nodes are classes and whose
arcs relationships among classes.
Class Model
• For example,
State Model
2. State Model:
• For the life history of objects.
• The state model specifies and implements control with
state diagrams.
• A state diagram is a graph whose nodes are states and
whose arcs are transitions between states caused by
events.
Interaction Model
3. Interaction Model:
• For the interactions among objects.
• The interaction model start with use case with activity
and sequence diagram.
• A use case focuses on the functionality of a system – that
is, what a system does for users.
• A sequence diagram shows the objects that interact and
the time sequence of their interactions.
• An activity diagram elaborates important processing
steps.
Interaction Model
• Use cases ,sequence diagrams, and activity diagrams
document the interaction model.
• Use cases document major themes for interaction
between the system and outside actors.
• Sequence diagrams show the objects that interact and
the time sequence of their interactions
• Activity diagrams show the floe of control among the
processing steps of a computations.
Modeling
• A model is an abstraction of something for the purpose of
understanding it before building it.
a) Testing a physical entity before building it.
b) Communication with customers.
c) Visualization.
d) Reduction of complexity.
Relationship Among the Models
• Each models describes one aspect of the system but
contains references to the other models.
• The class model describes data structure on which the state
and interaction models operate.
• The operations in the class model correspond to events and
actions.
• The state model describes the control structure of objects.
• It shows decisions that depend on object values and causes
actions that change object values and state.
• The interaction model focuses on the exchange between
objects and provides a holistic overview of the operation of
a system.
TEXTBOOK EXERCISES
1.5)All objects have identity and are distinguishable. However,
for large collections of objects, it may not be a trivial matter
to devise a scheme to distinguish them. Furthermore, a
scheme may depend on the purpose of the distinction. For
each of the
following collections of objects, describe how they could be
distinguished:
TEXTBOOK EXERCISES
• a . All persons in the world for the purpose of sending mail.
Country; state or province; city; street and number;
apartment, suite, or mail drop; name (ie, USA ->
Florida -> Orlando -> 633 N Orange Ave -> Mail Point 85 ->
Mark Zieg)
• b . All persons in the world for the purpose of criminal
investigations.
Known aliases, fingerprints, photo, results of restriction-
enzyme DNA tests (ie, Andrew Wiggen, AKA Ender Wiggen,
AKA Xenocide)
TEXTBOOK EXERCISES
• c . All customers with safe deposit boxes in a given bank.
Box number (ie, 1258)
• d . All telephones in the world for making telephone calls.
National code, local exchange (area code), local number (ie, 10-
104 (407) 420-6072)
• e . All customers of a telephone company for billing purposes.
Area code, telephone number (ie, (407) 420-6072)
• f . All electronic mail addresses throughout the world.
Server domain or IP, account name (ie,
mzieg@orlandosentinel.com)
• g . All employees of a company to restrict access for security
purposes.
Department; clearance level; name, social security number, or
employee number (ie, SYSTEMS-L15- 2072)
• A variable length array would make effective use of the following operations:
append, copy, count, delete, index, insert, and update. The only operation
which wouldn’t make a great deal of sense would be intersect. The append
operation makes sense because the ordered nature of the array presupposes
a ‘beginning’ and an ‘end’. The append operation would allow object users to
easily add something to the end of the array, in the manner of a queue or
other common data structure. Copy makes sense with any object, because
multiple object instantiations are frequently found in many common
applications. Count makes since because it provides a bound to the index
range, although the question didn’t specifically mention that the indexes had
to be sequential or positive values. Delete is another natural operation,
especially when parameterized with a beginning, end, or [index] indicator.
Index would be essential in order to access various elements. Insert would be
a more flexible version of append, and indeed under some interfaces render it
unnecessary. Update would be important in any application in which data
needed to be modified without going through a delete/insert sequence.
Intersect could readily be provided if really desired, but I haven’t had much
call do use such an operation on an ordered array.
• A symbol table uses a somewhat smaller set of operations. Here, copy,
delete, intersect, and update are the most likely candidates. Again, copy is
universally popular. Update, in the sense of an unordered insert, would be
necessary to propagate the table, and delete would be necessary to
• flush unnecessary values. Intersect somehow sounds more likely for this
class than for array,
• because you certainly need to compare elements of symbol tables when
linking libraries and object
• code. Some sort of operation to retrieve or read an entry would also be
necessary, although I
• wouldnÕt call it Òindex,Ó which suggests an ordered position rather than a
key value. Append,
• index, and the ordered insert make less sense because they provide
implementation-specific details
• which arenÕt necessary and contradict the tenets of OOD. Count could
perhaps be useful in certain
• systems, but many could do perfectly well without it.
• Finally a set could use copy, count, delete, intersect, and update
operationsÑalmost the same list
• as a symbol table, and for similar reasons. Copy is universal (as long as you
give due credit to
• your source :-) Update (unordered insert) and delete are fundamental to
all collections, and count is
• just plain handy to have around. Once again, some sort of read or retrieve
operation would be nice
• to have available, but index has all the wrong connotations. You could
have ÒdeleteÓ return an
• item, I suppose. On the other hand, append, index, and insert violate the
premise of
• Òunorderedness.Ó And having a set class without intersect (as well as
union) just wouldnÕt be
• proper.

More Related Content

PPTX
Importance & Principles of Modeling from UML Designing
ABHISHEK KUMAR
 
PPT
1.8 discretization
Krish_ver2
 
PPT
Object oriented analysis
Mahesh Bhalerao
 
PPTX
unit 5 Architectural design
devika g
 
PDF
Access Control: Principles and Practice
Nabeel Yoosuf
 
PPT
Chapter 14 - Protection
Wayne Jones Jnr
 
PPS
Java rmi
kamal kotecha
 
PPTX
Firewall Basing
Pina Parmar
 
Importance & Principles of Modeling from UML Designing
ABHISHEK KUMAR
 
1.8 discretization
Krish_ver2
 
Object oriented analysis
Mahesh Bhalerao
 
unit 5 Architectural design
devika g
 
Access Control: Principles and Practice
Nabeel Yoosuf
 
Chapter 14 - Protection
Wayne Jones Jnr
 
Java rmi
kamal kotecha
 
Firewall Basing
Pina Parmar
 

What's hot (20)

PDF
Object Oriented Analysis Design using UML
Ajit Nayak
 
PPT
Object Oriented Design in Software Engineering SE12
koolkampus
 
PPTX
Mobile databases
Dabbal Singh Mahara
 
PPT
Slide 4 Interaction Diagram
Niloy Rocker
 
PPTX
object oriented methodologies
Amith Tiwari
 
PPTX
Design Goals of Distributed System
Ashish KC
 
PDF
Classes and Objects
yndaravind
 
PPTX
Frame buffer
Aparna Joshi
 
DOCX
Multiversion Concurrency Control Techniques
Raj vardhan
 
PPT
10. XML in DBMS
koolkampus
 
PDF
Major and Minor Elements of Object Model
sohailsaif
 
PDF
Object oriented-systems-development-life-cycle ppt
Kunal Kishor Nirala
 
PPTX
Object relational database management system
Saibee Alam
 
PPTX
blackboard architecture
Nguyễn Ngân
 
PPTX
Object Oriented Programming
Iqra khalil
 
PPTX
Object oriented modeling and design
jayashri kolekar
 
PDF
Identifying classes and objects ooad
Melba Rosalind
 
PPTX
Back face detection
Pooja Dixit
 
PDF
State chart diagram
Preeti Mishra
 
PPT
Distributed data processing
Ayisha Kowsar
 
Object Oriented Analysis Design using UML
Ajit Nayak
 
Object Oriented Design in Software Engineering SE12
koolkampus
 
Mobile databases
Dabbal Singh Mahara
 
Slide 4 Interaction Diagram
Niloy Rocker
 
object oriented methodologies
Amith Tiwari
 
Design Goals of Distributed System
Ashish KC
 
Classes and Objects
yndaravind
 
Frame buffer
Aparna Joshi
 
Multiversion Concurrency Control Techniques
Raj vardhan
 
10. XML in DBMS
koolkampus
 
Major and Minor Elements of Object Model
sohailsaif
 
Object oriented-systems-development-life-cycle ppt
Kunal Kishor Nirala
 
Object relational database management system
Saibee Alam
 
blackboard architecture
Nguyễn Ngân
 
Object Oriented Programming
Iqra khalil
 
Object oriented modeling and design
jayashri kolekar
 
Identifying classes and objects ooad
Melba Rosalind
 
Back face detection
Pooja Dixit
 
State chart diagram
Preeti Mishra
 
Distributed data processing
Ayisha Kowsar
 
Ad

Similar to Ooad ch 2 (20)

PPT
Ooad ch 1_2
anujabeatrice2
 
PPTX
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
PPTX
Introduction
Preeti Mishra
 
PDF
Lecture 2 cst 205-281 oop
ktuonlinenotes
 
DOCX
Ooad notes
NancyJP
 
PDF
Software Design And Analysis Ii Lecture Notes Cuny Csci235 Itebooks
leemonadsiz
 
PPTX
Advanced Topics on Database - Unit-2 AU17
LOGANATHANK24
 
PPT
Chapter 02 The Object Model_Software E.ppt
AhammadUllah3
 
PPTX
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
18130208
 
PPTX
Object Oriented Principles
Emprovise
 
PDF
Object oriented software engineering concepts
Komal Singh
 
PPTX
CPP Object Oriented Concepts(OOPS).pptx
adityakumardas16
 
PDF
Object-Oriented Programming in Java (Module 1)
muhammadmubinmacadad2
 
PPT
Software Engineering Lec5 oop-uml-i
Taymoor Nazmy
 
PPTX
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
PPT
uml123 copy
Amit Sachan
 
PPTX
OOP Lecture 01.pptx
BilalWarraich15
 
PPT
Unit 1( modelling concepts & class modeling)
Manoj Reddy
 
PPT
Oomd unit1
VivekChaudhary93
 
PPT
Object analysis and design
Anand Grewal
 
Ooad ch 1_2
anujabeatrice2
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Introduction
Preeti Mishra
 
Lecture 2 cst 205-281 oop
ktuonlinenotes
 
Ooad notes
NancyJP
 
Software Design And Analysis Ii Lecture Notes Cuny Csci235 Itebooks
leemonadsiz
 
Advanced Topics on Database - Unit-2 AU17
LOGANATHANK24
 
Chapter 02 The Object Model_Software E.ppt
AhammadUllah3
 
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
18130208
 
Object Oriented Principles
Emprovise
 
Object oriented software engineering concepts
Komal Singh
 
CPP Object Oriented Concepts(OOPS).pptx
adityakumardas16
 
Object-Oriented Programming in Java (Module 1)
muhammadmubinmacadad2
 
Software Engineering Lec5 oop-uml-i
Taymoor Nazmy
 
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
uml123 copy
Amit Sachan
 
OOP Lecture 01.pptx
BilalWarraich15
 
Unit 1( modelling concepts & class modeling)
Manoj Reddy
 
Oomd unit1
VivekChaudhary93
 
Object analysis and design
Anand Grewal
 
Ad

More from anujabeatrice2 (6)

PPTX
Chapter 8 ooad
anujabeatrice2
 
PPTX
Chapter 7 ooad
anujabeatrice2
 
PPT
Ooad ch 5
anujabeatrice2
 
PPT
Ooad ch 4
anujabeatrice2
 
PPT
Ooad ch 3
anujabeatrice2
 
PPT
Ooad ch 6
anujabeatrice2
 
Chapter 8 ooad
anujabeatrice2
 
Chapter 7 ooad
anujabeatrice2
 
Ooad ch 5
anujabeatrice2
 
Ooad ch 4
anujabeatrice2
 
Ooad ch 3
anujabeatrice2
 
Ooad ch 6
anujabeatrice2
 

Recently uploaded (20)

PDF
Technical Writing Module-I Complete Notes.pdf
VedprakashArya13
 
PDF
Fundamentals and Techniques of Biophysics and Molecular Biology (Pranav Kumar...
RohitKumar868624
 
PDF
Mastering Financial Analysis Materials.pdf
SalamiAbdullahi
 
PPTX
Data Security Breach: Immediate Action Plan
varmabhuvan266
 
PPTX
Probability systematic sampling methods.pptx
PrakashRajput19
 
PDF
TIC ACTIVIDAD 1geeeeeeeeeeeeeeeeeeeeeeeeeeeeeer3.pdf
Thais Ruiz
 
PPTX
White Blue Simple Modern Enhancing Sales Strategy Presentation_20250724_21093...
RamNeymarjr
 
PPTX
Databricks-DE-Associate Certification Questions-june-2024.pptx
pedelli41
 
PDF
An Uncut Conversation With Grok | PDF Document
Mike Hydes
 
PPTX
Fluvial_Civilizations_Presentation (1).pptx
alisslovemendoza7
 
PDF
The_Future_of_Data_Analytics_by_CA_Suvidha_Chaplot_UPDATED.pdf
CA Suvidha Chaplot
 
PDF
D9110.pdfdsfvsdfvsdfvsdfvfvfsvfsvffsdfvsdfvsd
minhn6673
 
PDF
717629748-Databricks-Certified-Data-Engineer-Professional-Dumps-by-Ball-21-03...
pedelli41
 
PPTX
Data-Users-in-Database-Management-Systems (1).pptx
dharmik832021
 
PPTX
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
PPTX
Data-Driven Machine Learning for Rail Infrastructure Health Monitoring
Sione Palu
 
PDF
Key_Statistical_Techniques_in_Analytics_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
M1-T1.pptxM1-T1.pptxM1-T1.pptxM1-T1.pptx
teodoroferiarevanojr
 
PPTX
Pipeline Automatic Leak Detection for Water Distribution Systems
Sione Palu
 
PPTX
Multiscale Segmentation of Survey Respondents: Seeing the Trees and the Fores...
Sione Palu
 
Technical Writing Module-I Complete Notes.pdf
VedprakashArya13
 
Fundamentals and Techniques of Biophysics and Molecular Biology (Pranav Kumar...
RohitKumar868624
 
Mastering Financial Analysis Materials.pdf
SalamiAbdullahi
 
Data Security Breach: Immediate Action Plan
varmabhuvan266
 
Probability systematic sampling methods.pptx
PrakashRajput19
 
TIC ACTIVIDAD 1geeeeeeeeeeeeeeeeeeeeeeeeeeeeeer3.pdf
Thais Ruiz
 
White Blue Simple Modern Enhancing Sales Strategy Presentation_20250724_21093...
RamNeymarjr
 
Databricks-DE-Associate Certification Questions-june-2024.pptx
pedelli41
 
An Uncut Conversation With Grok | PDF Document
Mike Hydes
 
Fluvial_Civilizations_Presentation (1).pptx
alisslovemendoza7
 
The_Future_of_Data_Analytics_by_CA_Suvidha_Chaplot_UPDATED.pdf
CA Suvidha Chaplot
 
D9110.pdfdsfvsdfvsdfvsdfvfvfsvfsvffsdfvsdfvsd
minhn6673
 
717629748-Databricks-Certified-Data-Engineer-Professional-Dumps-by-Ball-21-03...
pedelli41
 
Data-Users-in-Database-Management-Systems (1).pptx
dharmik832021
 
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
Data-Driven Machine Learning for Rail Infrastructure Health Monitoring
Sione Palu
 
Key_Statistical_Techniques_in_Analytics_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
M1-T1.pptxM1-T1.pptxM1-T1.pptxM1-T1.pptx
teodoroferiarevanojr
 
Pipeline Automatic Leak Detection for Water Distribution Systems
Sione Palu
 
Multiscale Segmentation of Survey Respondents: Seeing the Trees and the Fores...
Sione Palu
 

Ooad ch 2

  • 1. Object Oriented Analysis & Design (OOAD) Unit-I Chapter – 2 Object Basics
  • 2. 2.1 Introduction • Understand Object by an example • Car  Object ( Real World Entity) • Properties • Methods
  • 3. What is object orientation? • Object Oriented (OO) means that we organize software as a collection of discrete objects that incorporate both data structure & behavior. • OO approach its generally include four aspects: 1. Identity 2. Classification 3. Inheritance 4. Polymorphism
  • 4. • Identity means that data is quantized into discrete, distinguishable entities called objects. • Each object has its own inherent identity. • In other words, two objects are distinct even if all their attributes values (such as name and size) are identical. • The white queen in a chess game for example of objects. Identity
  • 5. Objects can be: • External Entity (e.g., other systems, devices, people) that produce or consume information to be used by system • Things (e.g., reports, displays, letters, signals) that are part of information domain for the problem • Places (e.g., book’s room) that establish the context of the problem and the overall function of the system. • Organizational units (e.g., division, group, team, department) that are relevant to an application, • Transaction (e.g., loan, take course, buy, order). How to identify object?
  • 6. 6 Object Identity Behaviors State An employee “Mr. John” Join(), Retire() Joined, Retired. A book “Book with title Object Oriented Analysis Design” Add Exemplar, Rent, available, reserved A sale “Sale no 0015, 15/12/98” SendInvoiced(), Cancel(). Invoiced, cancelled. Object
  • 7. What is classification? • Classification means that objects with the same data structure (attributes) and behavior (operations) are grouped into a class. • For example Paragraph, Monitor & Chess Piece. • Class is a collection of objects. • A Class is an abstraction that describes properties important to an application and ignores the rest. • Any choice of classes is arbitrary and depends on the applications. • For example, Fruit mango, apple, banana…etc.
  • 8. Classification • Each Class describes a possibly infinite set of individual objects. • Each object is said to be an instance of its class. • An object has its own value for each attribute but shares the attribute names and operations with other instances of the class.
  • 9. What is Inheritance? 3. Inheritance : • Inheritance is the process, in which one object can use the properties of another object. • It allows the declaration and implementation of one class to based an existing class. • The concept of inheritance provides the idea of reusability.. Parent Base or Super class Child Derived or Sub class Parent + Child features Parent features
  • 10. Inheritance • Inheritance is the sharing of attributes and operations (features) among classes based on a hierarchical relationship. • A Super class has general information that subclasses refine and elaborate. • Each subclass incorporates, or inherits, all the features of its super class and adds its own unique features. • Subclasses need not repeat the features of the super class. • For example, Scrolling Window and Fixed Window are subclasses of Window.
  • 11. Inheritance • Both subclasses inherit the features of Window, such as a visible region on the screen. • Scrolling Window adds a scroll bar and an offset. • The ability to factor out common features of several classes into a super class can greatly reduce repetition within designs and programs and is one of the main advantages of OO technology. Bird Flying Bird Non Flying Bird
  • 12. What is Polymorphism? • Polymorphism means the ability to take more than one form. • It allows a single name to be used for more than one related purpose. • It can be also defined as the property that allows an operation to have different behavior on different objects. Shape SquareCircle name getName( ) calculateArea( ) side calculateArea( ) radius calculateArea( )
  • 13. What is Polymorphism? • An operations is a procedure or transformation that an object perform is subject to. • For example , Polygon objects ---------- Polygon class Attributes -vertices -border color -fill color Operations -draw -erase -move
  • 14. Polymorphism • An implementation of an operation by a specific class is called a method. • Because an OO operator is polymorphic, it may have more than one method implementing it, each for a different class of object.
  • 15. Abstraction • Abstraction is the selective examination of certain aspects of a problem. • Creating new data types using encapsulated items is known as data abstraction. • It is also the process of grouping the attributes and functions to operate these attributes. • And the data type created by the data abstraction are known as Abstract Data Types (ADT). • Attributes : is known as data members.
  • 16. Abstraction • Abstraction is the presentation of simple concept (or object) to the external world. • Abstraction concept is to describe a set of similar concrete entities. • It focuses on the essential, inherent aspects of an entity and ignoring its accidental properties. • The abstraction concept is usually used during analysis: deciding only with application-domain concepts, not making design and implementation decisions.
  • 17. Abstraction • Two popular abstractions: procedure abstraction and data abstraction. • Procedure abstraction is to decompose problem to many simple sub-works. • Data abstraction is to collect essential elements composing to a compound data. • These two abstractions have the same objective: reusable and replaceable.
  • 18. Abstraction • Below figure shows an example of data abstraction to abstract doors as a data structure with essential properties. • Example of Data Abstraction.
  • 19. Three Models • We use three kinds of models to describe a system from different viewpoints: 1. Class Model 2. State Model 3. Interaction Model • Class Model: For the objects in the system & their relationships. • State Model: For the life history of objects. • Interaction Model: For the interactions among objects.
  • 20. Class Model 1. Class Model: • For the objects in the system & their relationships. • The class model defines the context for software development – the universe of discourse. • The class model contains class diagrams. • A class diagram is a graph whose nodes are classes and whose arcs relationships among classes.
  • 22. State Model 2. State Model: • For the life history of objects. • The state model specifies and implements control with state diagrams. • A state diagram is a graph whose nodes are states and whose arcs are transitions between states caused by events.
  • 23. Interaction Model 3. Interaction Model: • For the interactions among objects. • The interaction model start with use case with activity and sequence diagram. • A use case focuses on the functionality of a system – that is, what a system does for users. • A sequence diagram shows the objects that interact and the time sequence of their interactions. • An activity diagram elaborates important processing steps.
  • 24. Interaction Model • Use cases ,sequence diagrams, and activity diagrams document the interaction model. • Use cases document major themes for interaction between the system and outside actors. • Sequence diagrams show the objects that interact and the time sequence of their interactions • Activity diagrams show the floe of control among the processing steps of a computations.
  • 25. Modeling • A model is an abstraction of something for the purpose of understanding it before building it. a) Testing a physical entity before building it. b) Communication with customers. c) Visualization. d) Reduction of complexity.
  • 26. Relationship Among the Models • Each models describes one aspect of the system but contains references to the other models. • The class model describes data structure on which the state and interaction models operate. • The operations in the class model correspond to events and actions. • The state model describes the control structure of objects. • It shows decisions that depend on object values and causes actions that change object values and state. • The interaction model focuses on the exchange between objects and provides a holistic overview of the operation of a system.
  • 27. TEXTBOOK EXERCISES 1.5)All objects have identity and are distinguishable. However, for large collections of objects, it may not be a trivial matter to devise a scheme to distinguish them. Furthermore, a scheme may depend on the purpose of the distinction. For each of the following collections of objects, describe how they could be distinguished:
  • 28. TEXTBOOK EXERCISES • a . All persons in the world for the purpose of sending mail. Country; state or province; city; street and number; apartment, suite, or mail drop; name (ie, USA -> Florida -> Orlando -> 633 N Orange Ave -> Mail Point 85 -> Mark Zieg) • b . All persons in the world for the purpose of criminal investigations. Known aliases, fingerprints, photo, results of restriction- enzyme DNA tests (ie, Andrew Wiggen, AKA Ender Wiggen, AKA Xenocide)
  • 29. TEXTBOOK EXERCISES • c . All customers with safe deposit boxes in a given bank. Box number (ie, 1258) • d . All telephones in the world for making telephone calls. National code, local exchange (area code), local number (ie, 10- 104 (407) 420-6072) • e . All customers of a telephone company for billing purposes. Area code, telephone number (ie, (407) 420-6072) • f . All electronic mail addresses throughout the world. Server domain or IP, account name (ie, [email protected]) • g . All employees of a company to restrict access for security purposes. Department; clearance level; name, social security number, or employee number (ie, SYSTEMS-L15- 2072)
  • 30. • A variable length array would make effective use of the following operations: append, copy, count, delete, index, insert, and update. The only operation which wouldn’t make a great deal of sense would be intersect. The append operation makes sense because the ordered nature of the array presupposes a ‘beginning’ and an ‘end’. The append operation would allow object users to easily add something to the end of the array, in the manner of a queue or other common data structure. Copy makes sense with any object, because multiple object instantiations are frequently found in many common applications. Count makes since because it provides a bound to the index range, although the question didn’t specifically mention that the indexes had to be sequential or positive values. Delete is another natural operation, especially when parameterized with a beginning, end, or [index] indicator. Index would be essential in order to access various elements. Insert would be a more flexible version of append, and indeed under some interfaces render it unnecessary. Update would be important in any application in which data needed to be modified without going through a delete/insert sequence. Intersect could readily be provided if really desired, but I haven’t had much call do use such an operation on an ordered array.
  • 31. • A symbol table uses a somewhat smaller set of operations. Here, copy, delete, intersect, and update are the most likely candidates. Again, copy is universally popular. Update, in the sense of an unordered insert, would be necessary to propagate the table, and delete would be necessary to • flush unnecessary values. Intersect somehow sounds more likely for this class than for array, • because you certainly need to compare elements of symbol tables when linking libraries and object • code. Some sort of operation to retrieve or read an entry would also be necessary, although I • wouldnÕt call it Òindex,Ó which suggests an ordered position rather than a key value. Append, • index, and the ordered insert make less sense because they provide implementation-specific details • which arenÕt necessary and contradict the tenets of OOD. Count could perhaps be useful in certain • systems, but many could do perfectly well without it.
  • 32. • Finally a set could use copy, count, delete, intersect, and update operationsÑalmost the same list • as a symbol table, and for similar reasons. Copy is universal (as long as you give due credit to • your source :-) Update (unordered insert) and delete are fundamental to all collections, and count is • just plain handy to have around. Once again, some sort of read or retrieve operation would be nice • to have available, but index has all the wrong connotations. You could have ÒdeleteÓ return an • item, I suppose. On the other hand, append, index, and insert violate the premise of • Òunorderedness.Ó And having a set class without intersect (as well as union) just wouldnÕt be • proper.