Title: Object Modeling THETOPPERSWAY.COM
1Object ModelingTHETOPPERSWAY.COM
2(No Transcript)
3(No Transcript)
4(No Transcript)
5(No Transcript)
6(No Transcript)
7Object Modelling Technique(OMT)
- Building a model of an application domain and
then adding implementation details to it. - Following four stages-
- Analysis
- System Design
- Object Design
- Implementation.
8Three Models
- Object Model describes the static structure of
objects in the system and their relationships. - Dynamic Model describes the aspect of the
system that change over time, i.e. interaction
among objects. - Functional Model describes data value
transformation in the system.
9Object Model
- Describes the structure of objects in a system-
- - Identity
- - Relationship to other objects
- - Their attributes
- - And their operations.
10Dynamic Model
- Describes those aspects of the system concerned
with time and sequencing of operations- - Events that make change
- Sequence of events
- States that define context of events
- And organization of events and states.
11Functional Model
- Describes those aspects of the system concerned
with transformation of values- - Functions
- Mappings
- Constraints
- Functional dependencies
- Is represented with Data Flow Diagrams.
12Objects and Classes
Interpretation in the Real World Interpretation in the Model
Object An object is a thing that can be distinctly identified. An object has an identity, a state, and a behavior.
Class A class represents a set of objects with similar characteristics and behavior. This objects are called the instances of the class. A class characterizes the structure of states and behaviors that are shared by all instances.
13Objects
- Each of object has a unique identity.
- The state of an object is composed of a set of
fields (data fields), or attributes. - Each field has a name, a type, and a value.
- Behaviors are defined by methods.
- Each method has a name, a type, and a value.
- Each method may or may not return a value.
- Features are a combination of the state and the
behavior of the object.
14Classes
- A class defines a template for creating or
instantiating its instances or objects. - A class is a description of a set of objects that
share the same attributes, operations,
relationships, and semantics.
15Example
- Class name Point class Point
- Fields x, y int x, y
- Method move public void move
- (int dx, int dy)
- // implementation
-
16UML Notation for Classes
ClassName The top compartment shows the class name.
field1 fieldn The middle compartment contains the declarations of the fields of the class.
method1 methodm The bottom compartment contains the declarations of the methods
17Object Model Notations
- Object classes are rectangles with the name at
the top, attributes in the middle section and
operations in the bottom section
18UML Notation for Object
ObjectName ClassName The top compartment shows the object name and its class.
field1 value1 fieldn valuen The bottom compartment contains a list of the fields and their values.
objectName -- objectName whose class is of no interest ClassName -- anonymous object of ClassName which can be identify only through its relationship with other object. objectName -- objectName whose class is of no interest ClassName -- anonymous object of ClassName which can be identify only through its relationship with other object.
19Examples
P1Point Point p1 new Point()
x 0 y 0 p1.x 0 P1.y 0
P1Point Point p1 new Point()
x 24 y 40 p1.x 24 P1.y 40
20Object Model Notations (Contd.)
- Relationships between object classes (known as
associations) are shown as lines linking objects
21Example
Sample Data
L3
P2
P1
L1
L4
(Line) L1
Intersects
L2
(Point) P1
(Line) L2
Line
Point
Intersects
(Line) L3
name
name
2
(Point) P2
(Line) L4
Class Diagram
Instance Diagram
22Associations
- Connection between objects
- Solid line
- Direction optional
- Arrowhead depends on meaning
- Name (optional)
- Multiplicities (optional)
- Visibility (optional)
23Association
- Association represents binary relationship
between classes
enroll
Student
Course
advisee
teach
1
1
Faculty
adviser
24Aggregation
- An aggregation model shows how classes that are
collections are composed of other classes. - Aggregation models are similar to the part-of
relationship in data models.
25Aggregation and Compositon
- Aggregation is a special form of association
- Has-a or part-whole relationship
- Composition is a stronger form of aggregation
26Example
1
1
1
University
Department
College
Student
1
1
Chairman-of
Member-of
1
1..
Faculty
27Inheritance
- Define a relationship among classes and
interfaces - Inheritance model -- the is-a(n) relationship
28Example
29Multiple inheritance
30Generalization
- Models the concept of inheritance
- Subclasses inherit the attributes and operations
of all their superclasses - Objects of a subclass should be substitutable for
objects of their superclasses - Uses hollow triangle arrowhead on superclass
31Generalisation Example
Generalization
Specialization
32Abstract Classes
- Used to hold common operations and data
- Used in inheritance hierarchy
- Derived (child) classes provide implementations
- Documented with class name in italics
- Can also use abstract property
Shape abstract
move() erase() void abstract draw() void
abstract
33Constraints
- A restriction in the design
- Documented inside curly braces attached to any
diagram element
Window
length
width
0.5lt(length/width)lt1.5
34Metadata
- Data about data.
- Data that describes other data.
- Metadata is defined as data providing information
about one or more aspects of the data, such as - Means of creation of the data
- Purpose of the data
- Time and date of creation
- Creator or author of data
- Location on a computer where the data was
created.
35Candidate Keys
- Minimal set of attributes that uniquely
identifies an object or link. - It is denoted by braces C.K.
- Candidate key(Person, Company)
Person
Company
Works-for
name
name
36THANKS.