SlideShare a Scribd company logo
Object Modeling
Preeti Mishra
Course Instructor
An overview of OOSE development
activities and their products
Requirements
elicitation
Analysis
System design
problem statement
functional
model
nonfunctional
requirements
analysis
object model
dynamic
model
class diagram
use case
diagram
statechart
diagram
sequence diagram
An Introduction to Object Modeling
– The approach of using object modeling
during systems analysis and design is
called object-oriented analysis.
• Object-oriented analysis (OOA) techniques
are used to
– (1) study existing objects to see if they can be reused or
adapted for new uses, and to
– (2) define new or modified objects that will be combined
with existing objects into a useful business computing
application.
Definition : Object Modeling
– The object-oriented approach is centered
around a technique referred to as object
modeling.
• Object modeling is a technique for identifying
objects within the systems environment, and the
relationships between those objects.
Why do we model
• Models help us to visualize a system as it is or as we want it
to be.
• Models permit us to specify the structure or behavior of a
system.
• Models give us a template that guides us in constructing a
system.
• Models document the decisions we have made.
System concepts for
Object Modeling
• Object and related concepts
– What is and isn’t an Object
– Attribute, state
– Behavior/ operations
– Roles- responsibilities
– Identity
– Life span
System concepts for
Object Modeling
• Objet Oriented Concepts:
– Abstraction
– Encapsulation
– Inheritance
– Modularity
– Polymorphism
Principles of Modeling
• The choice of what models to create has a profound
influence on how a problem is attacked and how a solution is
shaped.
• Every model may be expressed at different levels of
precision.
• The best models are connected to reality.
• No single model is sufficient. Every nontrivial system is
best approached through a small set of nearly independent
models.
Activities during Object Modeling
Main goal: Find the important abstractions
• Steps during object modeling
1. Class identification
– Based on the fundamental assumption that we can find abstractions
2. Find the attributes
3. Find the methods
4. Find the associations between classes
• Order of steps
• Goal: get the desired abstractions
• Order of steps secondary, only a heuristic
– What happens if we find the wrong abstractions?
• We iterate and revise the model
Class Identification
Class identification is crucial to object-
oriented modeling
– Helps to identify the important entities of a
system
• Basic assumptions:
1. We can find the classes for a new software
system (Forward Engineering)
2. We can identify the classes in an existing
system (Reverse Engineering)
• Why can we do this?
– Philosophy, science, experimental evidence.
Class Identification
• Approaches
– Application domain approach
• Ask application domain experts to identify relevant
abstractions
– Syntactic approach
• Start with use cases
• Analyze the text to identify the objects
• Extract participating objects from flow of events
– Design patterns approach
• Use reusable design patterns
– Component-based approach
• Identify existing solution classes.
Class identification is a
Hard Problem
• One problem: Definition of the system boundary:
– Which abstractions are outside, which abstractions are
inside the system boundary?
• Actors are outside the system
• Classes/Objects are inside the system.
• An other problem: Classes/Objects are not just
found by taking a picture of a scene or domain
– The application domain has to be analyzed
– Depending on the purpose of the system different
objects might be found
• How can we identify the purpose of a system?
• Scenarios and use cases => Functional model
There are different
types of Objects
• Entity Objects
– Represent the persistent information tracked
by the system (Application domain objects, also
called “Business objects”)
• Boundary Objects
– Represent the interaction between the user
and the system
• Control Objects
– Represent the control tasks performed by the
system.
Relationships Among
objects
Types of Relationships
• Objects contribute to the behavior of a system by
collaborating with one another.
• The relationship between any two objects encompasses
the assumptions that each makes about the other
• two kinds of object hierarchies are of particular
interest in object-oriented analysis and design, namely:
– Links
– Aggregation
– Simple relations
Types of Relationships
• Objects can work together in three different
types of relationships:
• Uses(links/ Association): An object can use
another to do some work (association).
• Composition: A complex object may be composed
of several parts (aggregation, containment).
• Simple(links): Two objects may depend on each
other but don’t interact directly (weak
association)
Links/ Uses/ Association
• Semantics The term link derives from Rumbaugh, who
defines it as a "physical or conceptual connection between
objects" .
• An object collaborates with other objects through its links
to these objects.
• Stated another way, a link denotes the specific association
through which one object (the client) applies the services
of another object (the supplier), or through which one
object may navigate to another.
• Message passing between two objects is typically
unidirectional, although it may occasionally
• be bidirectional.
Objects that Use Objects
(Links/ Uses)
• Whenever one object sends a message to another object
(even if object
• Doesn’t send messages back), a uses relationship is
established them.
• Ex: A SalesInvoice uses a Customer object
• Six different
Techniques For Implementing A Uses/
Links/ Association Relationship
Object 1 uses object 2
1. Object 2 as Arguments
2. Creating Your Own objects 2
3. Third Party object 2
4. Combining Constructors
5. Passing an Argument
6. Creating Objects On-The-Fly
As argument
• Option would be to pass the object2 as an argument to
the constructor of the object1
• Rule for Using Objects
• You should use an attribute when:
– The obj needs to be directed from several different methods, or
the obj stores persistent state info between method calls.
– The obj you are going to use is used repeatedly.
– The obj is very expensive or time consuming to construct, and you
will use the obj more than once.
Creating Your Own objects
• A second solution is to construct the object2 in the object1
class constructor.
Third Party object
• It assumes that a repository of Customers
(CustomerDB) keeps track of all Customer objects
Combining Constructors
• Give the object1 class two constructors and use a
no-argument constructor when you want to create
a new object1.
Passing an Argument
• Sometimes an object may have a very short and
transitory relationship with another object.
• You may need to use an object only during the execution
of a single method.
• In that case, you might choose to have the method take
as an argument an instance of the object it uses
This is appropriate when:
• The obj you are going to use will be used in a single method,
and the state of that obj doesn’t need to be retained
between calls.
• The obj you have to use carries with it some immediate state
info thatmust be renewed each time the method is called.
• The obj you’re using is easily constructed outside your class.
If,however, it’s easier for you (using class) to construct the
obj from scratch(because of some special knowledge), use
the objects on-the-fly technique.
This is appropriate when:
• If an identical obj is constructed over and over,
or it it’s very time-consuming to construct an obj
and you need to use it more than once,
• you should use a referential attribute to hold a
reference to the obj you’ll use, rather than pass it
as an argument or create it on-the-fly
Creating objects
on the fly
• A second way to get an object that will be used in only a
single method is to create it inside the method itself.
• This has the advantage that
– it makes the calling method easier, and that
– the code where the object is created inside the method is
inherently more maintainable.
• This technique is called for when the using object has
special knowledge that required to create the object that
it will use
Roles
• As a participant in a link, an object may play one of three
roles:
– Actor An object that can operate upon other objects but is
never operated upon by other objects; in some contexts, the
terms active object and actor are
interchangeable
– Server An object that never operates upon other objects; it is
only operated upon by other objects
– Agent An object that can both operate upon other objects and
be operated upon by other objects; an agent is usually created to
do some work on behalf of an actor or another agent
Synchronization
• Synchronization Whenever one object passes a message to
another across a link, the two objects are said to be
synchronized.
• However, in the presence of multiple threads of control,
objects require more sophisticated message passing in
order to deal with the problems of mutual exclusion that
can occur in concurrent systems.
• As we described earlier, active objects embody their own
• thread of control, and so we expect their semantics to be
guaranteed in the presence of other active objects.
Approach to Synchronization
• we must choose one of three approaches to
synchronization:
• Sequential :The semantics of the passive object are
guaranteed only in the presence of a single active object at
a time.
• Guarded :The semantics of the passive object are
guaranteed in the presence of multiple threads of control,
but the active clients must collaborate to achieve mutual
exclusion.
• Synchronous: The semantics of the passive object are
guaranteed in the presence of multiple threads of control,
and the supplier guarantees mutual exclusion.
Aggregate
• Semantics Whereas links denote peer-to-peer or
client/supplier relationships, aggregation
• denotes a whole/part hierarchy, with the ability to navigate
from the whole (also called the aggregate) to its parts (also
known as its attributes). In this sense, aggregation is a
specialized kind of association.
Aggregation
• Aggregation may or may not denote physical containment.
For example, an airplane is
• composed of wings, engines, landing gear, and so on: this is
a case of physical containment.
• On the other hand, the relationship between a shareholder
and her shares is an aggregation
• relationship that does not require physical containment.
Aggregation
• There are clear trade-offs between links and aggregation.
Aggregation is sometimes better because it encapsulates
parts as secrets of the whole.
• Links are sometimes better because they permit looser
coupling among objects.
• Intelligent engineering decisions require careful weighing
of these two factors.
• By implication, an object that is an attribute of another
has a link to its aggregate. Across this link, the aggregate
may send messages to its parts.
Cardinality/ Multiplicity
• No of participants in a relationships is shown by its
cardinality value
• The Multiplicity of an association indicates with how many
objects the opposing class of an object can be
instantiated.
• When this number is variable, then the bandwidth - or
minimum and maximum - is indicated 3..7 .
• If the minimum is 0, this means that the relationship is
optional (the relationship is still there, only the number of
elements is 0).
• If the minimum is equal to the maximum, only one value is
written.
Association – example
• In a home theatre system,
– A TV object has an association with a
VCR object
• It may receive a signal from the VCR
– VCR may be associated with remote
• It may receive a signal (command) to
record
VCR TV
1
Connected to
1
Remote
1
commands
1
Rakesh Shukla
V. Ramesh
760901-1234
691205-5678
People Tax_files
tax_file
1-1 Association – example
People Tax_files
1 1
Associated
with
Kunti
Bhim
Arjun
Women People
motherOf
Multiple Association – example
motherOf
Yudhistir
motherOf
Women People
1 *
Mother of
left right example
1 1 one-to-one person <-> weight
0..1 1
optional on one
side one-to-one
date of death <->
person
0..* or * 0..* or *
optional on both
sides many-to-
many
person <-> book
1 1..* one-to-many
Birth Place <->
person
one (1): Indicates that exactly one entity type instance exists at the
association end.
zero or one (0..1): Indicates that zero or one entity type instances exist
at the association end.
many (*): Indicates that zero, one, or more entity type instances exist at
the association end.
• A teacher teaches 1 to 3 courses
(subjects)
• Each course is taught by only one teacher.
• A student can take between 1 to 5 courses.
• A course can have 10 to 300 students.
Association – Multiplicity
Teacher Course
teaches 1..31
Students
takes
1..5
10..300
Try them
• 1. These relationships are read in the following way:
– An event has a seating plan.
– A seating plan is allocated to a venue.
• 2. A seating plan has unlimited capacity, but usually only
one seat.
• A seat belongs to one specific seating plan.
• Every seating plan belongs to one specific event.
• An event may contain an unlimited number of seating plans.
• The seating plan can also be assigned to another event
(Aggregation), but must in any case always have one event.
• The seat is part of a seating plan; this relationship can
never be changed (Composition).
Multiplicity in
Aggregation
Combining them
Class
• A class is a set of objects that share a common structure
and a common behaviour.
• A single object is simply an instance of a class.
What isn't a class?
• An object is not a class, although, curiously
• class may be an object. Objects that share no common
structure and behaviour cannot be grouped in a class
because, by definition, they are unrelated except by their
general nature as objects.
Template for object creation:
 Instantiated into objects
 An abstract data type (ADT)
Examples: Employees, Books, etc.
Sometimes not intended to produce
instances:
 Abstract classes
Class
UML Class Representation
• A class represents a set of objects having similar
attributes, operations, relationships and behavior.
Window
size: Size
visibility: boolean
display()
hide()
Class Name
Inline Attributes
Operations
A class can
implicitly
have a few
association
attributes
Class Modeling
Terms and Concepts
• A class is a description of a set of objects that share
the same attributes, operations, relationships, and
semantics.
• Graphically, a class is rendered as a rectangle.
Class: Name
• Every class must have a name that distinguishes it from
other classes.
• A name is a textual string.
• That name alone is known as a simple name; a path name is
the class name prefixed by the name of the package in
which that class lives.
• A class may be drawn showing only its name
Class: Name
• A class name may be text consisting of any number of
letters, numbers, and certain punctuation marks (except
for marks such as the colon, which is used to separate a
class name and the name of its enclosing package)
• Typically, you capitalize the first letter of every word in a
class name, as in Customer or TemperatureSensor.
Attribute
• Attributes are related to the semantics of aggregation.
• An attribute is a named property of a class that describes
a range of values that instances of the property may hold.
A class may have any number of attributes or no attributes
at all.
• An attribute represents some property of the thing you
are modeling that is shared by all objects of that class.
• An attribute is therefore an abstraction of the kind of
data or state an object of the class might encompass.
• At a given moment, an object of a class will have specific
values for every one of its class's attributes.
• Graphically, attributes are listed in a compartment just
below the class name.
• An attribute name may be text, just like a class
name. In practice, an attribute name is
• a short noun or noun phrase that represents some
property of its enclosing class.
• Typically, you capitalize the first letter of every
word in an attribute name except the
• first letter, as in name or loadBearing.
Operation
• An operation is the implementation of a service that can
be requested from any object of the class to affect
behavior.
• A class may have any number of operations or no
operations at all.
• Often (but not always), invoking an operation on an
object changes the object's data or state.
• Graphically, operations are listed in a compartment just
below the class attributes.
• Operations may be drawn showing only their names,
Operation
• You can specify an operation by stating its signature,
covering the name, type, and default value of all
parameters and (in the case of functions) a return type,
Responsibility
• Responsibility is a contract or an obligation of a class.
When you create a class,
• At a more abstract level, these corresponding attributes
and operations are just the features by which the class's
responsibilities are carried out.
• Graphically, responsibilities can be drawn in a separate
compartment at the bottom of the class icon
Class Diagram
• Captures the vocabulary of a system
Other Features
• Sometimes, however, you'll need to visualize or specify
other features, such as the visibility of individual
attributes and operations;
• language-specific features of an operation,
• such as whether it is polymorphic or constant; or even the
exceptions that objects of the class might produce or
handle.
• These and many other features can be expressed in the
UML, but they are treated as advanced concepts
Modeling Techniques
• Modeling vocabulary of system
• Modeling the Distribution of Responsibilities in a System
• Modeling Non-software Things
• Modeling Primitive Types
Hints and Tips
• When you model classes in the UML, remember that
every class should map to some tangible or conceptual
abstraction in the domain of the end user or the
implementer.
• A well-structured class Provides a crisp abstraction of
something drawn from the vocabulary of the problem
domain or the solution domain.
• Embodies a small, well-defined set of responsibilities and
carries them all out very well.
Hints and Tips
• Provides a clear separation of the abstraction's
specification and its implementation.
• Is understandable and simple yet extensible and
adaptable.
• Show only those properties of the class that are
important to understanding the abstraction in its
context.
• Organize long lists of attributes and operations
by grouping them according to their category.
• Show related classes in the same class diagrams.
Relationships
• Relationships provide a pathway for communication
between objects
• Sequence and/or collaboration diagrams are
examined to determine what links between objects
need to exist to accomplish the behavior -- if two
objects need to “talk” there must be a link between
them
Basic Relationship Types
• Association
• Dependency
• Aggregation
• Generalization
• Realization
Relationships: Defined
• An association is a bi-directional connection between
classes
– An association is shown as a line connecting the related classes
• An aggregation is a stronger form of relationship where the
relationship is between a whole and its parts
– An aggregation is shown as a line connecting the related classes with a diamond next
to the class representing the whole
• A dependency relationship is a weaker form of relationship
showing a relationship between a client and a supplier where
the client does not have semantic knowledge of the supplier.
– A dependency is shown as a dashed line pointing from the client to the supplier
Generalization
(Inheritance)
• A generalization is a relationship between a more
general and a more specific element
– Inheritance is the main property of generalization-
specialization relationships defined between a superclass
and its subclasses
– Common attributes, operations, and/or relationships are
shown at the highest applicable level in the hierarchy
• Realization is a relationship defined between a type
and its implementation classes
Relationships: Notation• Association
• Dependency
• Aggregation
• Generalization
• Realization
type Implementation
class
Sub
clas
s
Superclass
AggregatePart
SupplierClient name

More Related Content

What's hot

ADO .Net
ADO .Net ADO .Net
ADO .Net
DrSonali Vyas
 
Ooad
OoadOoad
Use case diagram
Use case diagramUse case diagram
Use case diagram
City University
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
AnilPokhrel7
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Sudarsun Santhiappan
 
Class Diagram
Class DiagramClass Diagram
Class Diagram
Rana_brothers
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
Nadia_Nazeer
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
Mubashir Jutt
 
Component Diagram
Component DiagramComponent Diagram
Component Diagram
Ahmed Yousef
 
Corba
CorbaCorba
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
Haitham El-Ghareeb
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
ASHOK KUMAR PALAKI
 
Type constructor
Type constructorType constructor
Type constructor
krishnakanth gorantla
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
Pooja mittal
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
Motaz Saad
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
Komal Singh
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
Prem Lamsal
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
Manish Kumar
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
Rahul Pola
 
Basic Structural Modeling
Basic Structural ModelingBasic Structural Modeling
Basic Structural Modeling
AMITJain879
 

What's hot (20)

ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Ooad
OoadOoad
Ooad
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Class Diagram
Class DiagramClass Diagram
Class Diagram
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
Component Diagram
Component DiagramComponent Diagram
Component Diagram
 
Corba
CorbaCorba
Corba
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Type constructor
Type constructorType constructor
Type constructor
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
Basic Structural Modeling
Basic Structural ModelingBasic Structural Modeling
Basic Structural Modeling
 

Viewers also liked

Unit 5 design engineering ssad
Unit 5 design engineering ssadUnit 5 design engineering ssad
Unit 5 design engineering ssad
Preeti Mishra
 
Oo concepts and class modeling
Oo concepts and class modelingOo concepts and class modeling
Oo concepts and class modeling
Preeti Mishra
 
Unit 8 software quality and matrices
Unit 8 software quality and matricesUnit 8 software quality and matrices
Unit 8 software quality and matrices
Preeti Mishra
 
architectural design
 architectural design architectural design
architectural design
Preeti Mishra
 
Unit 7 performing user interface design
Unit 7 performing user interface designUnit 7 performing user interface design
Unit 7 performing user interface design
Preeti Mishra
 
Component level design
Component   level designComponent   level design
Component level design
Midhula Chandren
 
software development, process model, requirement engineering, srs, structured...
software development, process model, requirement engineering, srs, structured...software development, process model, requirement engineering, srs, structured...
software development, process model, requirement engineering, srs, structured...
Ashok Mohanty
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
naina-rani
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
Preeti Mishra
 

Viewers also liked (9)

Unit 5 design engineering ssad
Unit 5 design engineering ssadUnit 5 design engineering ssad
Unit 5 design engineering ssad
 
Oo concepts and class modeling
Oo concepts and class modelingOo concepts and class modeling
Oo concepts and class modeling
 
Unit 8 software quality and matrices
Unit 8 software quality and matricesUnit 8 software quality and matrices
Unit 8 software quality and matrices
 
architectural design
 architectural design architectural design
architectural design
 
Unit 7 performing user interface design
Unit 7 performing user interface designUnit 7 performing user interface design
Unit 7 performing user interface design
 
Component level design
Component   level designComponent   level design
Component level design
 
software development, process model, requirement engineering, srs, structured...
software development, process model, requirement engineering, srs, structured...software development, process model, requirement engineering, srs, structured...
software development, process model, requirement engineering, srs, structured...
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 

Similar to Object modeling

Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
Hiệp Tiến
 
oomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.pptoomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.ppt
Pavan992098
 
common design patterns summary.pdf
common design patterns summary.pdfcommon design patterns summary.pdf
common design patterns summary.pdf
NikolayRaychev2
 
Object analysis and design
Object analysis and designObject analysis and design
Object analysis and design
Anand Grewal
 
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
Ganapathi M
 
Jeet ooad unit-2
Jeet ooad unit-2Jeet ooad unit-2
Jeet ooad unit-2
Jitendra s Rathore
 
Analysis
AnalysisAnalysis
Analysis
Preeti Mishra
 
Object oriented programming
Object oriented programmingObject oriented programming
10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx
huzaifaahmed79
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Mahesh Bhalerao
 
Object Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxObject Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptx
ethiouniverse
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summary
guestebd714
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summary
achraf_ing
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
Techglyphs
 
note2_DesignPatterns (1).pptx
note2_DesignPatterns (1).pptxnote2_DesignPatterns (1).pptx
note2_DesignPatterns (1).pptx
ReemaAsker1
 
Object model
Object modelObject model
Object model
Young Alista
 
Object model
Object modelObject model
Object model
Harry Potter
 
Object model
Object modelObject model
Object model
Fraboni Ec
 
Object model
Object modelObject model
Object model
Luis Goldster
 
Object model
Object modelObject model
Object model
Tony Nguyen
 

Similar to Object modeling (20)

Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 
oomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.pptoomd-unit-i-cgpa.ppt
oomd-unit-i-cgpa.ppt
 
common design patterns summary.pdf
common design patterns summary.pdfcommon design patterns summary.pdf
common design patterns summary.pdf
 
Object analysis and design
Object analysis and designObject analysis and design
Object analysis and design
 
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
 
Jeet ooad unit-2
Jeet ooad unit-2Jeet ooad unit-2
Jeet ooad unit-2
 
Analysis
AnalysisAnalysis
Analysis
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Object Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptxObject Oriented Programming Tutorial.pptx
Object Oriented Programming Tutorial.pptx
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summary
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summary
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
 
note2_DesignPatterns (1).pptx
note2_DesignPatterns (1).pptxnote2_DesignPatterns (1).pptx
note2_DesignPatterns (1).pptx
 
Object model
Object modelObject model
Object model
 
Object model
Object modelObject model
Object model
 
Object model
Object modelObject model
Object model
 
Object model
Object modelObject model
Object model
 
Object model
Object modelObject model
Object model
 

More from Preeti Mishra

Effective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labsEffective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labs
Preeti Mishra
 
Uml intro
Uml introUml intro
Uml intro
Preeti Mishra
 
Component diagram
Component diagramComponent diagram
Component diagram
Preeti Mishra
 
Activity diag
Activity diagActivity diag
Activity diag
Preeti Mishra
 
Object diagram
Object diagramObject diagram
Object diagram
Preeti Mishra
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
Preeti Mishra
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
Preeti Mishra
 
Use case Diagram
Use case DiagramUse case Diagram
Use case Diagram
Preeti Mishra
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
Preeti Mishra
 
requirements analysis and design
requirements analysis and designrequirements analysis and design
requirements analysis and design
Preeti Mishra
 
Design process interaction design basics
Design process interaction design basicsDesign process interaction design basics
Design process interaction design basics
Preeti Mishra
 
Design process design rules
Design process  design rulesDesign process  design rules
Design process design rules
Preeti Mishra
 
Design process evaluating interactive_designs
Design process  evaluating interactive_designsDesign process  evaluating interactive_designs
Design process evaluating interactive_designs
Preeti Mishra
 
Foundations understanding users and interactions
Foundations  understanding users and interactionsFoundations  understanding users and interactions
Foundations understanding users and interactions
Preeti Mishra
 
IntrIntroduction
IntrIntroductionIntrIntroduction
IntrIntroduction
Preeti Mishra
 
Coupling coheshion tps
Coupling coheshion tpsCoupling coheshion tps
Coupling coheshion tps
Preeti Mishra
 
Software testing part
Software testing partSoftware testing part
Software testing part
Preeti Mishra
 
Dynamic modeling
Dynamic modelingDynamic modeling
Dynamic modeling
Preeti Mishra
 
Introduction
IntroductionIntroduction
Introduction
Preeti Mishra
 
Functional modeling
Functional modelingFunctional modeling
Functional modeling
Preeti Mishra
 

More from Preeti Mishra (20)

Effective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labsEffective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labs
 
Uml intro
Uml introUml intro
Uml intro
 
Component diagram
Component diagramComponent diagram
Component diagram
 
Activity diag
Activity diagActivity diag
Activity diag
 
Object diagram
Object diagramObject diagram
Object diagram
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
 
Use case Diagram
Use case DiagramUse case Diagram
Use case Diagram
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
 
requirements analysis and design
requirements analysis and designrequirements analysis and design
requirements analysis and design
 
Design process interaction design basics
Design process interaction design basicsDesign process interaction design basics
Design process interaction design basics
 
Design process design rules
Design process  design rulesDesign process  design rules
Design process design rules
 
Design process evaluating interactive_designs
Design process  evaluating interactive_designsDesign process  evaluating interactive_designs
Design process evaluating interactive_designs
 
Foundations understanding users and interactions
Foundations  understanding users and interactionsFoundations  understanding users and interactions
Foundations understanding users and interactions
 
IntrIntroduction
IntrIntroductionIntrIntroduction
IntrIntroduction
 
Coupling coheshion tps
Coupling coheshion tpsCoupling coheshion tps
Coupling coheshion tps
 
Software testing part
Software testing partSoftware testing part
Software testing part
 
Dynamic modeling
Dynamic modelingDynamic modeling
Dynamic modeling
 
Introduction
IntroductionIntroduction
Introduction
 
Functional modeling
Functional modelingFunctional modeling
Functional modeling
 

Recently uploaded

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
mahaffeycheryld
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
Yasser Mahgoub
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 

Recently uploaded (20)

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 

Object modeling

  • 2. An overview of OOSE development activities and their products Requirements elicitation Analysis System design problem statement functional model nonfunctional requirements analysis object model dynamic model class diagram use case diagram statechart diagram sequence diagram
  • 3. An Introduction to Object Modeling – The approach of using object modeling during systems analysis and design is called object-oriented analysis. • Object-oriented analysis (OOA) techniques are used to – (1) study existing objects to see if they can be reused or adapted for new uses, and to – (2) define new or modified objects that will be combined with existing objects into a useful business computing application.
  • 4. Definition : Object Modeling – The object-oriented approach is centered around a technique referred to as object modeling. • Object modeling is a technique for identifying objects within the systems environment, and the relationships between those objects.
  • 5. Why do we model • Models help us to visualize a system as it is or as we want it to be. • Models permit us to specify the structure or behavior of a system. • Models give us a template that guides us in constructing a system. • Models document the decisions we have made.
  • 6. System concepts for Object Modeling • Object and related concepts – What is and isn’t an Object – Attribute, state – Behavior/ operations – Roles- responsibilities – Identity – Life span
  • 7. System concepts for Object Modeling • Objet Oriented Concepts: – Abstraction – Encapsulation – Inheritance – Modularity – Polymorphism
  • 8. Principles of Modeling • The choice of what models to create has a profound influence on how a problem is attacked and how a solution is shaped. • Every model may be expressed at different levels of precision. • The best models are connected to reality. • No single model is sufficient. Every nontrivial system is best approached through a small set of nearly independent models.
  • 9. Activities during Object Modeling Main goal: Find the important abstractions • Steps during object modeling 1. Class identification – Based on the fundamental assumption that we can find abstractions 2. Find the attributes 3. Find the methods 4. Find the associations between classes • Order of steps • Goal: get the desired abstractions • Order of steps secondary, only a heuristic – What happens if we find the wrong abstractions? • We iterate and revise the model
  • 10. Class Identification Class identification is crucial to object- oriented modeling – Helps to identify the important entities of a system • Basic assumptions: 1. We can find the classes for a new software system (Forward Engineering) 2. We can identify the classes in an existing system (Reverse Engineering) • Why can we do this? – Philosophy, science, experimental evidence.
  • 11. Class Identification • Approaches – Application domain approach • Ask application domain experts to identify relevant abstractions – Syntactic approach • Start with use cases • Analyze the text to identify the objects • Extract participating objects from flow of events – Design patterns approach • Use reusable design patterns – Component-based approach • Identify existing solution classes.
  • 12. Class identification is a Hard Problem • One problem: Definition of the system boundary: – Which abstractions are outside, which abstractions are inside the system boundary? • Actors are outside the system • Classes/Objects are inside the system. • An other problem: Classes/Objects are not just found by taking a picture of a scene or domain – The application domain has to be analyzed – Depending on the purpose of the system different objects might be found • How can we identify the purpose of a system? • Scenarios and use cases => Functional model
  • 13. There are different types of Objects • Entity Objects – Represent the persistent information tracked by the system (Application domain objects, also called “Business objects”) • Boundary Objects – Represent the interaction between the user and the system • Control Objects – Represent the control tasks performed by the system.
  • 15. Types of Relationships • Objects contribute to the behavior of a system by collaborating with one another. • The relationship between any two objects encompasses the assumptions that each makes about the other • two kinds of object hierarchies are of particular interest in object-oriented analysis and design, namely: – Links – Aggregation – Simple relations
  • 16. Types of Relationships • Objects can work together in three different types of relationships: • Uses(links/ Association): An object can use another to do some work (association). • Composition: A complex object may be composed of several parts (aggregation, containment). • Simple(links): Two objects may depend on each other but don’t interact directly (weak association)
  • 17. Links/ Uses/ Association • Semantics The term link derives from Rumbaugh, who defines it as a "physical or conceptual connection between objects" . • An object collaborates with other objects through its links to these objects. • Stated another way, a link denotes the specific association through which one object (the client) applies the services of another object (the supplier), or through which one object may navigate to another. • Message passing between two objects is typically unidirectional, although it may occasionally • be bidirectional.
  • 18. Objects that Use Objects (Links/ Uses) • Whenever one object sends a message to another object (even if object • Doesn’t send messages back), a uses relationship is established them. • Ex: A SalesInvoice uses a Customer object • Six different
  • 19. Techniques For Implementing A Uses/ Links/ Association Relationship Object 1 uses object 2 1. Object 2 as Arguments 2. Creating Your Own objects 2 3. Third Party object 2 4. Combining Constructors 5. Passing an Argument 6. Creating Objects On-The-Fly
  • 20. As argument • Option would be to pass the object2 as an argument to the constructor of the object1 • Rule for Using Objects • You should use an attribute when: – The obj needs to be directed from several different methods, or the obj stores persistent state info between method calls. – The obj you are going to use is used repeatedly. – The obj is very expensive or time consuming to construct, and you will use the obj more than once.
  • 21. Creating Your Own objects • A second solution is to construct the object2 in the object1 class constructor.
  • 22. Third Party object • It assumes that a repository of Customers (CustomerDB) keeps track of all Customer objects
  • 23. Combining Constructors • Give the object1 class two constructors and use a no-argument constructor when you want to create a new object1.
  • 24. Passing an Argument • Sometimes an object may have a very short and transitory relationship with another object. • You may need to use an object only during the execution of a single method. • In that case, you might choose to have the method take as an argument an instance of the object it uses
  • 25. This is appropriate when: • The obj you are going to use will be used in a single method, and the state of that obj doesn’t need to be retained between calls. • The obj you have to use carries with it some immediate state info thatmust be renewed each time the method is called. • The obj you’re using is easily constructed outside your class. If,however, it’s easier for you (using class) to construct the obj from scratch(because of some special knowledge), use the objects on-the-fly technique.
  • 26. This is appropriate when: • If an identical obj is constructed over and over, or it it’s very time-consuming to construct an obj and you need to use it more than once, • you should use a referential attribute to hold a reference to the obj you’ll use, rather than pass it as an argument or create it on-the-fly
  • 27. Creating objects on the fly • A second way to get an object that will be used in only a single method is to create it inside the method itself. • This has the advantage that – it makes the calling method easier, and that – the code where the object is created inside the method is inherently more maintainable. • This technique is called for when the using object has special knowledge that required to create the object that it will use
  • 28.
  • 29. Roles • As a participant in a link, an object may play one of three roles: – Actor An object that can operate upon other objects but is never operated upon by other objects; in some contexts, the terms active object and actor are interchangeable – Server An object that never operates upon other objects; it is only operated upon by other objects – Agent An object that can both operate upon other objects and be operated upon by other objects; an agent is usually created to do some work on behalf of an actor or another agent
  • 30. Synchronization • Synchronization Whenever one object passes a message to another across a link, the two objects are said to be synchronized. • However, in the presence of multiple threads of control, objects require more sophisticated message passing in order to deal with the problems of mutual exclusion that can occur in concurrent systems. • As we described earlier, active objects embody their own • thread of control, and so we expect their semantics to be guaranteed in the presence of other active objects.
  • 31. Approach to Synchronization • we must choose one of three approaches to synchronization: • Sequential :The semantics of the passive object are guaranteed only in the presence of a single active object at a time. • Guarded :The semantics of the passive object are guaranteed in the presence of multiple threads of control, but the active clients must collaborate to achieve mutual exclusion. • Synchronous: The semantics of the passive object are guaranteed in the presence of multiple threads of control, and the supplier guarantees mutual exclusion.
  • 32. Aggregate • Semantics Whereas links denote peer-to-peer or client/supplier relationships, aggregation • denotes a whole/part hierarchy, with the ability to navigate from the whole (also called the aggregate) to its parts (also known as its attributes). In this sense, aggregation is a specialized kind of association.
  • 33. Aggregation • Aggregation may or may not denote physical containment. For example, an airplane is • composed of wings, engines, landing gear, and so on: this is a case of physical containment. • On the other hand, the relationship between a shareholder and her shares is an aggregation • relationship that does not require physical containment.
  • 34. Aggregation • There are clear trade-offs between links and aggregation. Aggregation is sometimes better because it encapsulates parts as secrets of the whole. • Links are sometimes better because they permit looser coupling among objects. • Intelligent engineering decisions require careful weighing of these two factors. • By implication, an object that is an attribute of another has a link to its aggregate. Across this link, the aggregate may send messages to its parts.
  • 35. Cardinality/ Multiplicity • No of participants in a relationships is shown by its cardinality value • The Multiplicity of an association indicates with how many objects the opposing class of an object can be instantiated. • When this number is variable, then the bandwidth - or minimum and maximum - is indicated 3..7 . • If the minimum is 0, this means that the relationship is optional (the relationship is still there, only the number of elements is 0). • If the minimum is equal to the maximum, only one value is written.
  • 36. Association – example • In a home theatre system, – A TV object has an association with a VCR object • It may receive a signal from the VCR – VCR may be associated with remote • It may receive a signal (command) to record VCR TV 1 Connected to 1 Remote 1 commands 1
  • 37. Rakesh Shukla V. Ramesh 760901-1234 691205-5678 People Tax_files tax_file 1-1 Association – example People Tax_files 1 1 Associated with
  • 38. Kunti Bhim Arjun Women People motherOf Multiple Association – example motherOf Yudhistir motherOf Women People 1 * Mother of
  • 39. left right example 1 1 one-to-one person <-> weight 0..1 1 optional on one side one-to-one date of death <-> person 0..* or * 0..* or * optional on both sides many-to- many person <-> book 1 1..* one-to-many Birth Place <-> person one (1): Indicates that exactly one entity type instance exists at the association end. zero or one (0..1): Indicates that zero or one entity type instances exist at the association end. many (*): Indicates that zero, one, or more entity type instances exist at the association end.
  • 40. • A teacher teaches 1 to 3 courses (subjects) • Each course is taught by only one teacher. • A student can take between 1 to 5 courses. • A course can have 10 to 300 students. Association – Multiplicity Teacher Course teaches 1..31 Students takes 1..5 10..300
  • 41. Try them • 1. These relationships are read in the following way: – An event has a seating plan. – A seating plan is allocated to a venue. • 2. A seating plan has unlimited capacity, but usually only one seat. • A seat belongs to one specific seating plan. • Every seating plan belongs to one specific event. • An event may contain an unlimited number of seating plans. • The seating plan can also be assigned to another event (Aggregation), but must in any case always have one event. • The seat is part of a seating plan; this relationship can never be changed (Composition).
  • 42.
  • 43.
  • 46. Class • A class is a set of objects that share a common structure and a common behaviour. • A single object is simply an instance of a class.
  • 47. What isn't a class? • An object is not a class, although, curiously • class may be an object. Objects that share no common structure and behaviour cannot be grouped in a class because, by definition, they are unrelated except by their general nature as objects.
  • 48. Template for object creation:  Instantiated into objects  An abstract data type (ADT) Examples: Employees, Books, etc. Sometimes not intended to produce instances:  Abstract classes Class
  • 49. UML Class Representation • A class represents a set of objects having similar attributes, operations, relationships and behavior. Window size: Size visibility: boolean display() hide() Class Name Inline Attributes Operations A class can implicitly have a few association attributes
  • 51. Terms and Concepts • A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. • Graphically, a class is rendered as a rectangle.
  • 52. Class: Name • Every class must have a name that distinguishes it from other classes. • A name is a textual string. • That name alone is known as a simple name; a path name is the class name prefixed by the name of the package in which that class lives. • A class may be drawn showing only its name
  • 53. Class: Name • A class name may be text consisting of any number of letters, numbers, and certain punctuation marks (except for marks such as the colon, which is used to separate a class name and the name of its enclosing package) • Typically, you capitalize the first letter of every word in a class name, as in Customer or TemperatureSensor.
  • 54. Attribute • Attributes are related to the semantics of aggregation. • An attribute is a named property of a class that describes a range of values that instances of the property may hold. A class may have any number of attributes or no attributes at all. • An attribute represents some property of the thing you are modeling that is shared by all objects of that class. • An attribute is therefore an abstraction of the kind of data or state an object of the class might encompass. • At a given moment, an object of a class will have specific values for every one of its class's attributes. • Graphically, attributes are listed in a compartment just below the class name.
  • 55. • An attribute name may be text, just like a class name. In practice, an attribute name is • a short noun or noun phrase that represents some property of its enclosing class. • Typically, you capitalize the first letter of every word in an attribute name except the • first letter, as in name or loadBearing.
  • 56.
  • 57. Operation • An operation is the implementation of a service that can be requested from any object of the class to affect behavior. • A class may have any number of operations or no operations at all. • Often (but not always), invoking an operation on an object changes the object's data or state. • Graphically, operations are listed in a compartment just below the class attributes. • Operations may be drawn showing only their names,
  • 58.
  • 59. Operation • You can specify an operation by stating its signature, covering the name, type, and default value of all parameters and (in the case of functions) a return type,
  • 60. Responsibility • Responsibility is a contract or an obligation of a class. When you create a class, • At a more abstract level, these corresponding attributes and operations are just the features by which the class's responsibilities are carried out. • Graphically, responsibilities can be drawn in a separate compartment at the bottom of the class icon
  • 61. Class Diagram • Captures the vocabulary of a system
  • 62. Other Features • Sometimes, however, you'll need to visualize or specify other features, such as the visibility of individual attributes and operations; • language-specific features of an operation, • such as whether it is polymorphic or constant; or even the exceptions that objects of the class might produce or handle. • These and many other features can be expressed in the UML, but they are treated as advanced concepts
  • 63. Modeling Techniques • Modeling vocabulary of system • Modeling the Distribution of Responsibilities in a System • Modeling Non-software Things • Modeling Primitive Types
  • 64. Hints and Tips • When you model classes in the UML, remember that every class should map to some tangible or conceptual abstraction in the domain of the end user or the implementer. • A well-structured class Provides a crisp abstraction of something drawn from the vocabulary of the problem domain or the solution domain. • Embodies a small, well-defined set of responsibilities and carries them all out very well.
  • 65. Hints and Tips • Provides a clear separation of the abstraction's specification and its implementation. • Is understandable and simple yet extensible and adaptable. • Show only those properties of the class that are important to understanding the abstraction in its context. • Organize long lists of attributes and operations by grouping them according to their category. • Show related classes in the same class diagrams.
  • 66. Relationships • Relationships provide a pathway for communication between objects • Sequence and/or collaboration diagrams are examined to determine what links between objects need to exist to accomplish the behavior -- if two objects need to “talk” there must be a link between them
  • 67. Basic Relationship Types • Association • Dependency • Aggregation • Generalization • Realization
  • 68. Relationships: Defined • An association is a bi-directional connection between classes – An association is shown as a line connecting the related classes • An aggregation is a stronger form of relationship where the relationship is between a whole and its parts – An aggregation is shown as a line connecting the related classes with a diamond next to the class representing the whole • A dependency relationship is a weaker form of relationship showing a relationship between a client and a supplier where the client does not have semantic knowledge of the supplier. – A dependency is shown as a dashed line pointing from the client to the supplier
  • 69. Generalization (Inheritance) • A generalization is a relationship between a more general and a more specific element – Inheritance is the main property of generalization- specialization relationships defined between a superclass and its subclasses – Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy • Realization is a relationship defined between a type and its implementation classes
  • 70. Relationships: Notation• Association • Dependency • Aggregation • Generalization • Realization type Implementation class Sub clas s Superclass AggregatePart SupplierClient name