Questions tagged [class-diagram]

A class diagram describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes.

A class diagram describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes.

See class diagram

170 questions
48
votes
4 answers

UML class diagram notations: Differences between Association, Aggregation and Composition

I'm confused about some of the notations of UML class diagrams. Pretty sure I know what Association means. Any relationship between instances of two classes, where an instance of one class needs to know about an instance of the second class in…
Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
12
votes
3 answers

Software architecture vs System architecture vs Class diagrams?

I'm quite confused about the following terms: Software architecture Software application architecture is the process of defining a structured solution that meets all of the technical and operational requirements, while optimizing common quality…
KingBoomie
  • 545
  • 2
  • 5
  • 11
11
votes
3 answers

How do you annotate instantiation in UML class diagrams?

Given this pseudo code: class B { } class A : B { int val; }; alpha = new A(); What arrow do I draw between alpha and A in a UML class diagram? Is this even something UML is meant to do? +-------+ +-------+ +-------+ | alpha |…
Alexander Bird
  • 1,396
  • 1
  • 11
  • 15
9
votes
2 answers

What does the arrow mean in a Class Diagram?

I need help trying to understand what the meaning of the arrow in a UML Class Diagram is, more specifically in this Composite Diagram. What's the difference between the simple line (from a class to another one) and the arrow (not the inheritance…
John Smith
  • 101
  • 1
  • 1
  • 4
7
votes
4 answers

How to represent constants in UML class diagram?

I am working on developing a UML class diagram from C++ code. I have a classless header file that is basically a definitions file (it has structs, enums and defined constants). I know how to represent structs and enums in general, but I am unclear…
ÁEDÁN
  • 133
  • 1
  • 1
  • 6
6
votes
1 answer

Modelling java annotations in an UML class diagram

Goal: I am trying to create a UML class diagram for a java spring application. Spring uses a lot of annotations and I couldn't find any resources online on how to properly model them in UML. I know that there is this question and it gives a good…
6
votes
1 answer

How to model user management using UML class diagram?

I have school project where me and my team have to build a health care system. It consists of different modules including : A module for doctors : It allows a doctor to access the medical records of his patients, send indications to them, consult…
PolarCrow
  • 71
  • 1
  • 1
  • 5
6
votes
1 answer

How to display in compositional relationship that the item knows about the container?

I'm drawing a class diagram and noticed that sometimes I got a relationship (composition or aggregation) where the item uses the container, and sometimes not. What is the visual difference in a composition where the item class uses the container…
p1100i
  • 1,748
  • 1
  • 10
  • 11
6
votes
5 answers

How to Model a simple file-system by UML class diagram

I want to model a file system which contains both files and directories, and directories can contain either files or other directories. This is what I have reached so far: In OOSE book, however, a similar model is presented: Now I have two…
Isaac
  • 265
  • 2
  • 6
  • 11
5
votes
2 answers

How to improve this UML class diagram?

How can I improve this UML class diagram? I'm really confused about the relationship between Expense and Category, because Category and Expense can exist by themselves: you can register Expense and not assign a category, you can add new Categories…
CrushJelly
  • 61
  • 1
  • 5
5
votes
1 answer

How to correctly draw a UML class diagram with fully qualified association?

Given the following code I have to draw the corresponding class diagram: public class Shop { List clients; Storage store; User chief; Set invoices; } public class Invoice { Map rows; Client…
koalaok
  • 493
  • 5
  • 17
5
votes
1 answer

How can attributes/annotations be illustrated on a UML class diagram?

Many programming languages offer a way to annotate types. For instance, in .NET this can be achieved by deriving a custom attribute class from System.Attribute and then annotating another type with this: [AttributeUsage(AttributeTargets.Class,…
Lea Hayes
  • 1,033
  • 1
  • 10
  • 17
5
votes
3 answers

How bad is it to have two methods with the same name but different signatures in two classes?

I have a design problem related to a public interface, the names of methods, and the understanding of my API and code. I have two classes like this: class A: ... function collision(self): .... ... class B: .... function…
4
votes
2 answers

When modeling requirements, how can I depict class diagram attributes whose allowed values are custom defined and in finite number?

I'm drawing the class diagram that depicts the domain model of a system. This diagram is for requirements analysis purposes so it is completely implementation-agnostic. I want to communicate the allowed values for some attributes in some objects.…
cidra
  • 311
  • 2
  • 9
4
votes
1 answer

UML v2.5.1 correct notation of blanks in operations (methods)?

In the UML specification 2.5.1 (Link) on page 117 it is specified that the notation of operations (methods) should look like the following: [] ‘(‘ [] ‘)’ [‘:’ [] [‘[‘ ‘]’] [‘{‘…
Raphael
  • 151
  • 3
1
2 3
11 12