UML Tutorial for Beginners
Blog containing resources for uml like lecture notes, lecture videos, lab manual, uml diagrams, objective bits, important questions and more.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Structural Modeling. 6 Comments on Class Diagrams
3.2
(58)

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.

 

Common Properties

 


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


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,

  1. Identify the function or behavior of the part of a system you would like to model.
  2. For each function or mechanism identify the classes, interfaces, collaborations and relationships between them.
  3. Use scenarios (sequence of activities) to walk through these things. You may find new things or find that existing things are semantically wrong.
  4. 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,

  1. Identify the classes whose state must be saved over the lifetime of the application.
  2. Create a class diagram and mark these classes as persistent by using tagged values.
  3. Provide the structural details for these classes like the attributes, associations with other classes and the multiplicity.
  4. Minimize the common patterns which complicate the physical database design like cyclic associations, one-to-one associations and n-ary associations.
  5. Provide the behavior for these classes by listing out the operations that are important for data access and integrity.
  6. Wherever possible, use tools to convert the logical design to physical design.

 

class diagram database schema

 

Forward and Reverse Engineering

 

To forward engineer a class diagram,

  1. Identify the rules for mapping the models to the implementation language of your choice.
  2. 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.
  3. Use tagged values to specify the target language.
  4. Use tools to convert your models to code.

 

To reverse engineer the code,

  1. Identify the rules for mapping the implementation language to a model.
  2. Using a tool, navigate to the code that you want to reverse engineer. Use the tool to generate a new model.

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

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.

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

6 Comments

You can follow any responses to this entry through the RSS 2.0 feed.

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???

Leave a Reply

Your email address will not be published. Required fields are marked *