Structural Modeling Lecture 5 Courtesy to Dr.Dasgupta

advertisement
Structural Modeling
Lecture 5
Courtesy to
Dr.Dasgupta
Purpose of Structural Models



Reduce the “semantic gap” between the real world
and the world of software
Create a vocabulary for analysts and users
Represent things, ideas, and concepts of
importance in the application domain
Classes


Templates for creating instances or objects
 Concrete
 Abstract
Typical examples:
 Application domain, user interface, data structure, file structure,
operating environment, document, and multimedia classes
Attributes


Units of information relevant to the
description of the class
Only attributes important to the task should
be included
Operations


Action that instances/objects can take
Focus on relevant problem-specific
operations (at this point)
Relationships

Generalization


Aggregation


Enables inheritance of attributes and operations
Relates parts to wholes
Association

Miscellaneous relationships between classes
Responsibilities and
Collaborations

Responsibilities



Knowing
Doing
Collaboration

Objects working together to service a request
The Class Symbol
for the Class Diagram
Bank Account System Class Diagram
Enrollment Class Diagram
with Association Class
Class Diagram

Provides definition of system components

Contains important structural information for
the new system

Provides details describing database and
object-oriented program

Consists of problem domain classes and
implementation classes
Class Diagram Concepts



A static model that shows the classes and
relationships among classes that remain
constant in the system over time
Resembles the ERD, but depicts classes
which include both behaviors and states,
while entities in the ERD include only
attributes
Scope not system wide, but pertaining to a
single use-case
Class Diagram for Managing
Appointments
Class Diagram Syntax
Method Types



Constructor methods create new instances of a
class
Query methods determine the state of an object and
make information about that state available to the
system
Update methods will change the value of some or all
of the object’s attributes, resulting in a change of
state
Multiplicity
Association Class
Aggregation and
Generalization Associations
Aggregation or Whole-Part Relationships
A Generalization/Specialization
Hierarchy for Motor Vehicles
Steps in Creating a Class
Diagram
1. Identify classes
2. Identify attributes and operations
3. Draw relationships between classes
Class Diagram for Customer
Places Order (1)
Class Diagram for Customer
Places Order (2)
Class Diagram for Customer
Places Order (3)
Download