How to Create Class Diagrams
To create and evolve a conceptual class diagram, you need to iteratively model:
Classes
Responsibilities
Associations
Inheritance relationships
Composition associations
Vocabularies
Class diagram : are the best design tool
for development teams. This Diagram helps developers get the structure
of the system before the code is written, and helps to ensure that the
system is the best design.
Clas diagram used : to display classes
and packages in the system. Class a diagram give you a static system and
relation between them. Usually, make some single class diagram to
systems. Some will diagram showing a subset of classes and relatives.
Can be made some diagram according to desirable to get a complete
picture against system built.
Interfaces
The purpose of a class diagram is to depict the classes within a model. In an object oriented application,
classes have attributes (member
variables), operations (member functions) and relation-ships with other
classes. The UML class diagram can depict all these things quite easily.
The
fundamental element of the class diagram is an icon the represents a class. This icon is shown in.
Classes are interrelated to each other in
specific ways. In particular, relationships in class diagrams include
different types of logical connections. The following are such types of
logical connections that are possible in UML:
- Association
- Directed Association
- Reflexive Association
- Multiplicity
- Aggregation
- Composition
- Inheritance/Generalization
- Realization
Association
is a broad term that encompasses just about any logical connection or relationship between classes
Directed Association
refers to a directional relationship represented by a line with an arrowhead.
Reflexive Association
occurs when a class may have multiple functions or responsibilities
Multiplicity
is the active logical association when the cardinality of a class in relation to another is being depicted
Aggregation
refers to the formation of a particular class as a result of one class being aggregated or built as a collection
Composition
is very similar to the aggregation
relationship, with the only difference being its key purpose of
emphasizing the dependence of the contained class to the life cycle of
the container class.
Inheritance
refers to a type of relationship wherein
one associated class is a child of another by virtue of assuming the
same functionalities of the parent class
Realization
denotes the implementation of the functionality defined in one class by another class.
Simple class diagram with attributes and operations
In the example, a class called “loan
account” is depicted. Classes in class diagrams are represented by boxes
that are partitioned into three:
The top partition contains the name of the class.
The middle part contains the class’s attributes.
The bottom partition shows the possible operations that are associated with the class.
Those should be pretty easy to see in the
example: the class being described is a loan account, some of whose
attributes include the type of loan, the name of the borrower/loaner,
the specific date the loan was released and the loan amount. As in the
real world, various transactions or operations may be implemented on
existing loans such as renew and extend. The example shows how class
diagrams can encapsulate all the relevant data in a particular scenario
in a very systematic and clear way.
In object-oriented modeling, class
diagrams are considered the key building blocks that enable information
architects, designers, and developers to show a given system’s classes,
their attributes, the functions or operations that are associated with
them, and the relationships among the different classes that make up a
system.
Tidak ada komentar:
Posting Komentar