Professional Documents
Culture Documents
Experiment No 3a Handout
Experiment No 3a Handout
: 3a
1. Aim: Develop a Classes, Relationships, Class Diagrams, Advanced Classes and
Relationship
4. Theory:
The class identification is done from project specifications or SRS. Nouns are potential
classes, objects, fields .Verbs are potential methods or responsibilities of a class.
3. how various classes and related and how they interact or inherit from each other
Class name is written on the top of box. Write < > on top of interfaces' names. Use
italics for an abstract class name.
Operations / methods should mention all the functions/ actions taken by the class.
Example of a Class is as given below:
Fig. 1 UML Representation of a Class.
+ public
# protected
- private
~ package (default)
/ derived
+ public
# protected
- private
~ package (default)
Always underline static methods. Omit return_type on constructors and when return type
is void.
The hierarchies in class diagram are drawn top-down with arrows pointing upward to
parent. The line/arrow styles indicate whether parent is a(n) class(solid line, black
arrow), abstract class(solid line, white arrow) or interface(dashed line, white arrow).
Fig 2 Generalization
2. Associational Relationships:
It shows three important things:
1. Multiplicity (how many are used). It is either one to many, Many to One, or Many to
many.
2. Name
3. Navigability ( direction)
3. Multiplicity of Associations:
4. Association Types:
1. Aggregation: It is also known as : “is part of” relationship. Its symbols is a clear white
diamond.
Fig. 4 Aggreagtion
Fig. 5 Composition
3. Dependency: It is also called “uses temporarily”. Its symbol is a dotted line. It is used
as an implementation detail, not an intrinsic part of that object's state.
Fig 6 Dependency
So the following class diagram has been drawn considering all the points mentioned above:
Class diagram is also considered as the foundation for component and deployment diagrams.
Class diagrams are not only used to visualize the static view of the system but they are also used
to construct the executable code for forward and reverse engineering of any system.
Generally UML diagrams are not directly mapped with any object oriented programming
languages but the class diagram is an exception.
Class diagram clearly shows the mapping with object oriented languages like Java, C++ etc. So
from practical experience class diagram is generally used for construction purpose.
5. Procedure/ Program:
6. Results:
What is UML?
What are the advantages of UML diagrams?
How these modeling diagrams would help in software application development?
How do we represent private, public and protected in class diagrams?
9. References: