Documente Academic
Documente Profesional
Documente Cultură
OBJECT :
• Each object in a system has three characteristics: state, behavior, and identity.
Identity :
• Identity means that each object is unique even if its state is identical to that of
another object.
For example, Algebra 101, Section 1, and Algebra 101, Section 2 are two
objects in the Course Registration System. Although they are both course
offerings, they each have a unique identity.
For example, the CourseOffering class may be defined with the following
characteristics:
Attributes - location, time offered
Operations - retrieve location, retrieve time of day, add a student to the offering
.
Each object would have a value for the attributes and access to the operations
specified by the CourseOffering class.
In the UML, classes are represented as compartmentalized rectangles.
The top compartment contains the name of the class.
The middle compartment contains the structure of the class (attributes).
The bottom compartment contains the behavior of the class (operations) as shown
below.
C ourseOffereing
location
t im eoffered
get offering()
addoffering()
STEREOTYPES AND CLASSES :
<<Exception>>
IDENTIFICATION :
• Control classes coordinate the events needed to realize the behavior specified in
the use case.
In the early stages of the Elaboration Phase, a control class is added for
each actor/use case pair. The control class is responsible for the flow of events in
the use case.
In the early stages of the Elaboration Phase, a control class is added for
each actor/use case pair. The control class is responsible for the flow of events in
the use case.
For example, in the Course Registration System, a student
selects course offerings and if the course offering is available, the
student is added to it. This is done by a class called course
offering which is a Entity class.
The control class knows when the student should be
added; the course offering knows how to add the student.
The addition of a control class per actor/use case pair is
only an initial cut-as analysis and design continues, control
classes may be eliminated, split up, or combined.
Some Classes Representation in ESU :
1. ENTITY CLASS
<<entity Class>>
COurse Offering
(OR)
CourseOffering
2. Control Class
<<control class>>
(OR) Registration
Manager
RegistrationManag
er
3. Boundary class
<<Boundary class>>
(OR) RegistrationForm
RegistrationForm
DOCUMENTING CLASSES
UML NOTATION :
As packages are created, classes
in the model are relocated by
STUDENTS adding related classes into the
INFORMATION package..
OBJECTS AND CLASSES IN THE ESU COURSE REGISTRATION
PROBLEM :
Boundary Class
AddACourseOffering ProfessorCourseOptions
Entity Classes
Course courseOffering Professor
manages
Course
ProfessorCourseM
anager
ROLE NAMES :
THE END OF an association where it connects to a class is
called an association role. Role names can be used instead of
association names.
A role name is a noun that denotes how one class associates
with another. The role name is placed on the association near the
class that it modifies, and may be placed on one or both ends of an
association line.
• It is not necessary to have both a role name and an association name.
• Associations are named or role names are used only when the names are needed for
clarity.
+Teacher
Professor
courseOffering
MULTIPLICITY INDICATORS :
1 Exactly one
0 .. * Zero or more
1 .. * One or more
0 .. 1 Zero or one
5 .. 8 Specific range (5, 6, 7, or 8)
4 .. 7,9 Combination (4, 5, 6, 7, or 9)
Eg:
Professor
1..4
courseOffering
REFLEXIVE RELATIONSHIPS :
MULTIPLE OBJECTS BELONGING to the same class
may have to communicate with one another. This is shown on the
class diagram as a reflexive association or aggregation. Role names
rather than association names typically are used for reflexive
relationships.
0..n
Eg : +Pre-requisite
0..n
course
manages
ProfessorcourseMa CourseOffering
nager
USE CASE REALIZATION
Realization relationship
1: Open Registration
2: Issue Notice
4: check Availability
5: Course allotment
9: Issue bill
1: EnterPassword
2: Verify password
3: enter semester
4: Add an offering
5: display
6: S elect course
7: Get Offering
8: Get Offering
9: Get Offering
14: A dd P ro fessor
Collaboration diagrams
: student
3: apply for course
:registrationM
anager 2: Issue Notice
9: Issue bill
10: Pay provisions
7: forward List Of students
1: Open Registration
: Registrar
The following figure shows Collaboration
Diagram for Add Course Offering scenario.
1: EnterPassword
3: enter semester
4: Add an offering
2: Verify password
: AddCourseOffering
7: Get Offering
12: Set Offering
9: Get Offering
14: Add Professor
:
ProfessorcourseManager
: CourseOffering
8: Get Offering
13: Add Professor
: Course
CLASS DIAGRAMS
Relationship
Type
Sending Class Receiving Class
ProfessorCourseOptions AddACourseOffering Aggregation
AddACourseOffering ProfessorCourseManager Association
ProfessorCourseManager Course Association
Course CourseOffering Aggregation
Eg :
Class Diagram for Add Course Offering Scenario
Enterpassword() displayoffering()
Verifypasword() 1 1 selectoffering()
entersemester() selectcourse()
Addanoffering() display()
1
RegistrationUSer
Student
professor
Specialization :
This provides the ability to create subclasses that represent
refinements to the superclasses – typically structure and behavior
are added to the new subclass.
This method of finding inheritance considered if a class
already exists, and subclasses are added to specialize the behavior
of existing class. In this operations may be overridden by a
subclass.
However , a subclass should never restrict an operation
defined in its superclasses. That is subclass should never provide
less behavior or structure than its superclass.
Creation of Inheritance Tree :
<<entity class>>
RegistrationUser
<<entity class>>
RegistrationUser
0..4 3..10
0.. 4 0..4
<<entity class>
courseOffering
Aggregation :
Aggregation is a form of association. A hollow diamond
is attached to the end of the path to indicate aggregation.
However, the diamond may not be attached to both ends of a line,
it to be shown towards whole.
Inheritance should be used to show for the separation of
commonality from specifications. Where as Aggregation should
be used to show composite relationships. Often two types of
relationships can be represented in a class diagram
The following figure shown Combination of both
Generalization and Aggregation, here the student class is further
classified whether is a part-time student or Regular student.
<<entity class>>
RegistrationUser
0..4 3..10
0.. 4 0..4
Parttime Regular
<<entity class>
courseOffering
Association Class :
A Relationship in a class diagram may also have structure and
behaviour. Consider in ESU , a student can take four course offerings for a
semester, and every semester student will get report card which gives all his
grade details.
In that Grade is one which is not same in all four course for each
student so we cannot place in the student class, so for creating new class
called association class and provide association relationship with this class
to Relationship b/w Courseoffering and Student. And this association class
will have aggregation relationship with class called Report class as shown
below.
0..4 3..10
CourseOffering Student
1
1
0.. 4
ReportCard
Grade