To learn class diagrams, you must know about the concepts of classes, advanced classes, relationships and advanced relationships.
Now, let’s start learning about class diagrams in UML:
Class diagrams are most commonly found diagrams while modeling software systems. A class diagram consists of classes, collaborations and interfaces. A class diagram is used to model the static design view of the system.
Contents
Common Properties
The class diagram shares the common properties with the rest of the diagrams, a name and graphical elements that are a projection into the model. What distinguish the class diagram from the others are the contents of the diagram.
Contents
Class diagram contains the following:
- Classes
- Interfaces
- Collaborations
- Generalization, dependencies and associations
Like other diagrams, class diagrams may also contain notes and constraints. Class diagrams may also contain packages or subsystems which are used to organize the elements into groups. Generally, the class diagrams are used for:
- Modeling the vocabulary of the system
- Modeling the collaborations
- Modeling the logical database schema
Common Modeling Techniques
Modeling Simple Collaborations
To model simple collaborations,
- Identify the function or behavior of the part of a system you would like to model.
- For each function or mechanism identify the classes, interfaces, collaborations and relationships between them.
- Use scenarios (sequence of activities) to walk through these things. You may find new things or find that existing things are semantically wrong.
- Populate the things found in the above steps. For example, take a class and fill its responsibilities. Now, convert these responsibilities into attributes and operations.
Modeling a Logical Database Schema
To model a schema,
- Identify the classes whose state must be saved over the lifetime of the application.
- Create a class diagram and mark these classes as persistent by using tagged values.
- Provide the structural details for these classes like the attributes, associations with other classes and the multiplicity.
- Minimize the common patterns which complicate the physical database design like cyclic associations, one-to-one associations and n-ary associations.
- Provide the behavior for these classes by listing out the operations that are important for data access and integrity.
- Wherever possible, use tools to convert the logical design to physical design.
Forward and Reverse Engineering
To forward engineer a class diagram,
- Identify the rules for mapping the models to the implementation language of your choice.
- Depending on the semantics of the language, you may want to restrict the information in your UML models. For example, UML supports multiple inheritance. But some programming languages might not allow this.
- Use tagged values to specify the target language.
- Use tools to convert your models to code.
To reverse engineer the code,
- Identify the rules for mapping the implementation language to a model.
- Using a tool, navigate to the code that you want to reverse engineer. Use the tool to generate a new model.
Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
I need common modelling techniques of class not collaboration
I think you are mistaken. These are common modelling techniques for classes are only. Classes are used to create collaborations.
It works really well for me
I learned easily by reading this article
I like the article
Ohhh Really???