Is the class diagram same thing as class model? - uml

I had been doing some UML class diagram examples from the recent exams for my software design course, and I found one where it says:"Design a class model for a specific problem, by using MVC and STATE pattern, but no need to include getters and setters." Is this the same thing as the regular class diagram? I've been googling and I found nothing UML based by searching for class MODEL.

The model is abstract. A diagram is a view on the model. UML offers a number of different diagrams. There are mainly two categories: static and behavioral. Class diagrams fall under the static category and they show how the classes in the model are related to each other. You can create multiple class diagrams like one with all classes (assuming that you have a rather limited number of classes) and/or one per class with that in focus. Or you have sub-domains with related classes placed in one diagram. The behavioral diagrams shed light on how class instances communicate with each other at run time.
As a side note you can think of it in terms of Platon's Cave Allegory. The diagrams are the shadows of the real world projected by a fire to the wall you can see from you chained position.

"Design a class model" means: "Create one or more class diagrams that together form a consistent model".
A model in computer science is a graphical representation of (a piece of) software or of (a part of) the business domain in order to help people know or understand the subject the model represents (see wikipedia). This graphical representation may consist of one or more diagrams.

Related

UML Integrated Class Diagram

What is an integrated class diagram? what is the difference between a class diagram and an integrated class diagram? I have searched on google and youtube but could not find a proper explanation.
There is no notion of "integrated class diagram" defined in the UML specifications, and it's not a popular term if you search in specialized publications.
Unless you are learning a custom modelling technique inspired from UML, the term "integrated" shall therefore be taken in its usual system engineering sense: assembling parts together to make a working whole.
Applied to a class diagram, this would mean to either consolidate several models into a single one (e.g. for the purpose of integrating sub-systems), or assembling model parts (e.g. if you have separate class diagrams each focusing on specific parts of a system, and then want to show the big picture and how these groups of classes relate to each other).

Difference between the Domain Model & Activity Diagram

So I'm currently studying UML and I have a question regarding the difference between a Domain Model how this is compared with an Activity Diagram. I a bit confused with the following terms:
Activity Diagram (AD)
Domain Model (DM)
OO Domain Model (OO DM)
Class Diagram (as a term)
Domain Class Diagram (CD)
Design Class Diagram (DCD)
In Visual Paradigm, you have two the option between Activity & Class Diagrams to draw out your designs. So far I have been using Class Diagrams for my Domain Model but a friend of mine told me you should not be using Class Diagrams for your Domain Model. So my question what's the difference and how does a program like Visual Paradigm differentials with the standards of the subject I'm trying to learn.
Domain model and domain diagram do not exist in UML, so all depends on the definition you use.
If I look at the literature it seems the 'standard' diagram to show a domain model is a class diagram, may be associated with object diagram to show example of instances.
An activity is a behavior, to use common word an 'algorithm'. An activity can be used to model the body of an operation. The goal of an activity and a class are totally different, one cannot replace the other.
Even the definition in Wikipedia is a domain model is a conceptual model of the domain that incorporates both behaviour and data the associated diagram in the article is a class diagram. In the article the word behaviour visibly refer to the rules the business uses in relation to that data.
Anyway, whatever, all depends on what you have to model, there is no definitive rules saying in case 1 use only class diagram, in case 2 use only activity diagram, and so on. You use all the diagrams you want while they are adapted for to say something useful
Activity diagrams are used for represent the behavior which shows flow of control or object flow with emphasis on the sequence and conditions of the flow.
Example:
The class diagram is used to specify the relations that exist between the classes from your model, also you can represent their attributes and methods.
Example:
Going back to your question, if you want to represent the behavior of your model, I should recommend using an activity diagram, but if you only want to specify classes that you want to use and their relation then you can use a class diagram. 

Class diagram drawn from Use case description

I know that I can build a Class diagram from a database E-R Diagram (tables become classes, tables properties are the classes properties...)
But I'm looking for informations (or step by step like) to create a class diagram from a use case description (or even a sequence diagram).
(All I found now is that the sequence diagram objects becomes classes and the stimuli messages methodes)
Any idea ?
I used to TA in software engineering, and both create a class diagram from a textual definition as well as create a class diagram from a sequence diagram were regular exam questions.
Creating class diagrams from a specification should be covered in your lectures since its one of the most important things to learn. This site explains the workflow quite well in my opinion.
It is important to note, that in software engineering there never is just one solution. You can tackle problems in multiple ways each with their own benefits and problems. The most important step to learning is doing it yourself, just looking at solutions won't help you.
For creating class diagrams from a sequence diagram:
Objects are instance of classes, in most sequence diagrams there is only one instance of any given class. Therefore "objects become classes" is not technically correct but the right intention.
Messages represent method calls on the receiving object, ergo you need to add these methods to the class of the receiving object.
Any communicating classes need to be associated, else they could not call their methods.
We put focus on only modelling the information you can derive from the sequence diagram, e.g. in most cases you do not know multiplicities of associations.

Class diagram vs State diagram (UML)

Can someone give me an example of when is better to use State Diagram and when Class Diagram. Tnx in advance!
For what type of software system would you use state machine diagrams to model functional requirements?
For what type of software system is data modeling via UML class diagrams suitable?
A class diagram shows classes in their relation and their properties and methods.
A state diagram visualizes a class's states and how they can change over time.
In both cases you are talking about diagrams which are only a window into the model. The class relations define how the single classes relate to each other. A state machine can be defined for each class to show its states. In embedded systems you use state machines almost all the time but there are also state machines for business applications (you can do this if that).
This question reveals a very common misunderstanding. There are only thirteen types of diagram in UML. They're not used to describe different types of system, but to describe different aspects of the system you are documenting. Which you pick in any given situation is more a question of style, what you want to emphasize.
It is better to use state diagrams if you want to focus on how the system can go into different states in response to various events. Activity diagrams are better if you want to focus on activities being carried out in some order, sequence diagrams are better if you want to show messages being sent between entities.
The above are all types of diagram which show behaviour. Class diagrams are a different type of beast altogether, and show how structures of things fit together (as do package diagrams and component diagrams).
It might be worth pointing out that while UML does not include a "requirement" element type, the related modelling language SysML does. If you want to express a number of functional requirements on the form "the system shall" in a model, SysML is a better fit.
A state diagram shows the behavior of the class. A class model shows the relationship between two or more classes. It includes its properties/attributes...
A state is an allowable sequence of changes of objects of a class model.

Difference between a 'class diagram' and a 'design class diagram'

I have an assignment that states the following criteria:
For this view you may use a truncated version of
your Design Class Diagram (DCD) including
only the architecturally significant classes.
For context, this is for the Logical View of a 4 + 1 Architectural View. How does a design class diagram (DCD) differ from a regular class diagram? Is it the UML diagram without the functions or variables included (i.e. just the names of the classes and their interactions with each other)?
Most of the time, people model their code. That's good! In that case, class diagram modeling is used to graphically represent the structure of (object-oriented) classes: class, method, attribute, annotations with stereotypes. Imagine all the JPA, Spring, whatever annotations in the class diagram of a JPA-J2EE based architecture...
As it's said above, the "design class diagram" should only design your domain model, from an architecture level. What are the basic entities your structural system rely on?
No details about the programming language, no "dto", "dao" or technical stuff like that.
Here's a good example I use: online shopping cart domain model. It only contains the architecturally significant classes.
HTH, Tom
Still its amibigous to understand. The main difference between analysis class diagrams and design class diagram is the analysis phase focus on designing a class diagram without concerning about the implementation detail. where as, desgin modelling concern with the implementaion and architechture since, it the high-level static view of the system.

Resources