Class diagram usage in UML

11,366

Solution 1

You use classes to capture the vocabulary of the system you are developing.

This means you should turn the concepts you found in your requirements understanding into your "domain entities" and let them be represented into the class diagram.

These classes may include abstractions that are part of the problem domain,

enter image description here

https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRoONs8CzYit0VXZ9H7Au9MXgE8Fx0a2hsSOs8Kt3BLVWw_Il6U

BankAccount is a high level abstraction. CheckAccount and SavingsAccount are lower level abstractions.

as well as classes that make up an implementation

enter image description here

http://www.bitstorm.org/gameoflife/code/gameoflife-uml.png

In this other example you see an implementation diagram, which already involves technology with your design and implementation decisions.

Solution 2

Class diagrams can be used for Domain Model: Conceptual Classes

In Object Oriented analysis, we can create domain models

A domain model is the visual representation of real situation objects in the domain-problem space.

Why Create Domain Model?

To understand key concepts and the vocabulary of domain-problem space.

And

While we are developing software classes ,Domain classes give us inspiration.

For example here is a partial domain model for a Monopoly Game.

enter image description here

In this diagram "Die" is a real world "Die". And our aim is to understand "Monopoly" game.

Class diagramas can be used for Implementation : Software Classes

They are classes which we (will) implement in a programming language.They represent software abstractions. They are inspired from domain model but there is no one to one mapping between them.

Here is a sample partial simple Software Class diagram for Monopoly Game

enter image description here

Even you can use UML class diagram just explaining some concepts in any domain [ not related to any software development activity]

enter image description here

Share:
11,366
user2019510
Author by

user2019510

Updated on June 04, 2022

Comments

  • user2019510
    user2019510 almost 2 years

    As I read through

    " Unified Modeling Language User Guide, Grady Booch ,James Rumbaugh ,Ivar Jacobson Publisher: Addison Wesley First Edition October 20, 1998 "

    that :

    You use classes to capture the vocabulary of the system you are developing. These classes may include abstractions that are part of the problem domain, as well as classes that make up an implementation

    Could you please clarify the quoted sentences through simple example in UML and please focus on two bold sentences ?