|
|
|
Jagdish Gangolly |
|
State University of New York at Albany |
|
|
|
|
Classes |
|
Relationships |
|
Class Diagrams |
|
Advanced Classes: Classifiers |
|
Advanced Relationships |
|
Interfaces, Types & Roles |
|
|
|
|
|
|
A
Class is a set of objects that share the same attributes, relationships,
operations, and semantics. |
|
Class Name (unique, textual string, prefixed by
package name to give pathname) |
|
Attribute (named property of the class, takes
values from a specified domain) |
|
Relationships * |
|
Operations/Methods (implementation of a service
requested by any object of the class to affect behavior) |
|
Responsibility (contract or obligation of a
class) |
|
|
|
|
|
|
Specification of all the details in classes provides much of the
vocabulary of the application domain. |
|
STEPS: |
|
Identify things users/implementors use to
describe the problem or solution in the domain in order to find
abstractions |
|
For each abstraction, identify set of
responsibilities (class definition must be clear; responsibilities must be
balanced between classes) |
|
Provide attributes and operations needed to
carry out the responsibilities |
|
|
|
|
|
|
|
|
|
|
|
|
Class diagrams are used to: |
|
|
|
model the vocabulary of the system |
|
|
|
model simple collaborations |
|
|
|
Model database schema |
|
|
|
|
|
|
|
|
Identification of abstractions in the
application domain (described earlier) |
|
Need for examination of documents in the domain |
|
Examination of text in the domain |
|
|
|
|
Identification of collaborations |
|
Identification of classes interfaces and other
collaborations participating |
|
Identification of relationships in the
collaboration |
|
Use of scenarios to walk through the things in
collaborations |
|
|
|
|
Identification of classes in the model that
transcend application |
|
Creation of class diagram containing such
persistent classes |
|
Expanding the structural details of the classes
and the cardinalities of associations |
|
Simplification of the logical structure by
introducing intermediate abstractions |
|
Business rules on the manipulation of sets of
objects must be encapsulated in a higher layer |
|
|
|
|
Dependencies (using relationships: using another
class as an argument in the signature of an operation) |
|
|
|
Generalisation (A-KIND-OF relationship) |
|
|
|
Association (structural relationship) |
|
|
|
|
|
|
|
|
|
Name |
|
Role |
|
Multiplicity |
|
Zero-or-one:
0 .. 1 |
|
Exactly one: 1 |
|
One-or-more: 1 .. * |
|
Many: 0 .. * |
|
Inheritance (Single & Multiple) |
|
Aggregation (whole/part, IS-PART_OF) |
|
|
|
|
|
Visibility |
|
Public (+) |
|
Private
(-) |
|
Protected
(#) |
|
Scope |
|
Instance |
|
Classifier |
|
Abstract class (name in italics, Fig 9-5, p.126) |
|
Root & Leaf classes ({root}, {leaf}) |
|
Polymorphic operations |
|
|
|
|
|