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.

Filter by
Sorted by
Tagged with
0
votes
3answers
69 views

Coherence between sequence diagram and class diagram

Question 1 All participants in a sequence diagram must match a class in class diagram? Question 2 All class that represents some object that is created by the system needs a class that creates it? ...
0
votes
2answers
34 views

Modelling 2 composition relationships between 2 XML elements using UML

I want to model an XML schema that has the following composition relationships: A can contain B, and in another case B can contain A. Using a bi-directional composition is not an option here as it is ...
0
votes
0answers
39 views

Class Diagram Alternative for Qualified Association

I am using PlantUML and it unfortunately does not support qualifiers on a class. I simply want to show in PlantUML that a Task has a qualified association to User through the Task.userID property. A ...
0
votes
3answers
153 views

Diagram to show how one object “becomes” another?

I am working in a purchasing system where we take calls: public class Call { public List<CallItem> CallItems { get; set; } } The calls can be turned into quotes, where call items become ...
0
votes
1answer
70 views

Do I really need to build a class diagram AND a component diagram? [closed]

I'm modeling a system while improving my knowledge of software engineering. I am building a class diagram and a component diagram, but notice that when I tweak one, I have to alter the other. Also, I ...
0
votes
1answer
143 views

Relating subclasses of two classes

Suppose I have the following problem: I have Users who work in Departments. A user can work in multiple departments and a department can have multiple users. Each departament gives to its users only ...
-2
votes
1answer
152 views

UML class diagrams - how do I draw a class diagram that shows a self-reference? [closed]

So I have the following case. I have an interface A and an implementation AImpl. Now I have another implementation of A, called A2Impl, which references any instance of A besides implementing A ...
2
votes
2answers
90 views

What to do with data types with lots of connections in a UML class diagram

I have a Pose data type, consisting of x, y, and rotation values. This being a robotics application, the Pose data type is used in about a dozen places throughout the application. Connecting all ...
0
votes
4answers
194 views

Class diagram for electric guitar and bass

Hi I was recently asked this in an interview to represent a 6 string guitar and a 4 string bass in class structure. I am still new to software design and analysis so was not able to complete the ...
2
votes
1answer
80 views

Ternary association VS association class

I was wondering, are these 2 class diagrams equivalent EXCEPT the fact that in diagram A, a student doesn't have to have a study program? The way I see it - for example in diagram B a study program ...
0
votes
1answer
30 views

What are the differences and connections between UML Profile diagram & UML Class diagrams

I am doing research for developing a software platform and I have created some class diagrams for the platform. My supervisor adviced me to use UML profiles as well to describe the platform in a more ...
1
vote
2answers
48 views

In a Conceptual class diagram, should Abstract Classes and arrowed lines be utilised?

Since we are just describing the problem domain rather than showing how the actual software will be designed, does that mean that we should not need abstract classes to show inheritance and arrowed ...
0
votes
1answer
72 views

How to model an association class in a UML class diagram where only one of the class has access to it?

Given this scenario: "Clinicians can record their own notes for each patient, viewable only by them." I would model it like this: Clinician ----> Patient and "Notes" as an association class ...
0
votes
2answers
92 views

Usage of composition relationship between two class in UML

I'm having quite a difficulty with what i think would suit a Patient class and a Record class in UML Basically the Record class stores the patient's information such as name, vitals, gender, age and ...
0
votes
2answers
146 views

How to model scenarios in UML class diagram?

I'm doing a conceptual class diagram for an app that lets: Clinicians view the patient's lab results and their calculated Reynolds Risk Score. Clinicians make changes to one or more of the patient’s ...
-2
votes
1answer
325 views

Ordered vs sequence in association in UML

I am trying to understand UML class diagrams. Imagine two classes that are related with each other by association. What is the difference between {ordered} and {sequence} for the association?
1
vote
2answers
96 views

Composition - legal class diagram

I wanted to ask if this is a valid class diagram: I tend to think not, because it forces a certain wheel to belong to two vehicles at the same time (because of the 1 multiplicity). If the ...
0
votes
2answers
124 views

2 way multiplicity constraints in code

my goal is to convert this class diagram into Java code. How should I approach this, given that I want the constraints to hold at all times? It creates a chicken-egg problem where the first Course or ...
1
vote
2answers
321 views

How to model attribute dependency “inside one class” in UML class diagram?

I have the following "software reality in working code" (also no access to it): There is a class Class1 with different attributes AttributeA - sums up all "ordinary attributes" EnumType DataType ...
0
votes
2answers
152 views

Convert UML Class to Java Class

Suppose I have 3 UML Class diagrams. One is University, other is College, the other is Department. Each University can have multiple colleges, each college multiple departments. I have the UML class ...
0
votes
1answer
701 views

Why does the Square–Rectangle problem violate SOLID principles?

My previous question was just with class diagram and because of some comments I thought I try to find an example with a little piece of code for the diagram to see if principles correct understood? ...
1
vote
2answers
501 views

Which SOLID principles are broken by this class diagram?

I just read about all the 5 principles S,O,L,I,D and I like test it in little example if I understand them correct. Which SOLID principles are hurt by this class diagram? I think what is broken is ...
1
vote
2answers
210 views

When converting the ER into the class diagram, what happened to the Weak Entities in the ER diagram

I am trying to convert an ER diagram into a class diagram. Below image is showing that part of my ER diagram and which contains a weak entity call 'Parent'. Therefore when we consider the ER diagram, ...
1
vote
0answers
219 views

UML Class Diagram HashMap with different Key datatype using Qualified Association

By using the qualified association element of UML Class Diagram, we can create HashMap as the datatype of one of our class attributes (see here). In my case, I have to use HashMap with different key ...
-3
votes
1answer
2k views

UML Class Diagram HashMap Data Type

How can I show a Java HashMap data type in UML Class Diagram (or C# dictionary)? I.E. This class: public class Test { private Map<String, String> map; private Map<String, int> ...
1
vote
1answer
1k views

UML Class Diagram with reference data type

For the following UML Class diagram, I have a reference data type Nurse, and I am using it in Hospital Class, is it needed all the time to describe the reference data types in UML Class diagram? Is ...
3
votes
1answer
261 views

Can you place elements other than classes in a class diagram [closed]

I'm currently doing up class diagrams for a project I'm working on. I feel there's something that should be represented in my class diagram but I'm not quite sure. I have a .csv file which the ...
1
vote
1answer
147 views

Role design pattern in uml

In my UML class diagram, I have an interface called Contract which a Staff implements. There are two types of Staffs: one is partTime and the other is fullTime. Does that mean that the two partTime ...
0
votes
1answer
148 views

Class Diagram for Train-Wagon Senario

I have doubts on approaching doing this. I have a Train class and a Wagon class. There are three types of wagon: FirstClass, TouristClass and DiningCar. Each of these types has the same properties ...
2
votes
4answers
643 views

Is actor a own class

I have this sequence diagram and want to transform it into a class diagram. But I don't know if the actor (Customer) is in this case a own class or not. Normally the actor isn't a own class, but in ...
5
votes
4answers
8k views

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 ...
2
votes
2answers
268 views

Should I show the association class in my class diagram?

For example I have a relationship like this: user (0..*) buys product (0..*) Which results in an association class, called sale, which has the userID and productID. Just for the question's sake, ...
3
votes
3answers
3k views

UML Class Diagram: How to describe method functionality?

Recently, we have learned about UML class diagrams in university and I began applying that knowledge to my work projects. However, I am still unsure how or where I am supposed to describe the ...
0
votes
1answer
509 views

Should I make a separate class diagram for the administration part of my software?

I am building a software which has two types of users in it: main users and admins. I am still building the class diagram for this system. For the main user's relations I have things like: user ...
3
votes
1answer
7k views

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 ...
3
votes
1answer
923 views

Association + multiplicity vs aggregation and composition?

I know the differences between these associations (as described here). However I'm wondering: Composition, why not simply use an association with multiplicity of 1..* (and thus implicit saying that ...
3
votes
3answers
163 views

Can a parent class not have attributes or functions?

I have 3 Different Classes Which are representing different types of Sensors, for example: WaterLevelSensor DoorSensor TemperatureSensor Each Class has different functionality. Following the OOD ...
2
votes
2answers
114 views

When creating a UML class diagram, should I know which programming language will be used to develop the application?

I had to develop an application in Java for a school project, so I designed a UML class diagram oriented towards Java (including structures, attributes and types). For example: -getLists() : List<...
1
vote
1answer
363 views

Doubt about representing a Shopping Cart in Class Diagram/ER Database implicating ORM

I have to do a task which is reading a text, and create a Class diagram. One of the entities is a Shopping Cart. My doubt is how to represent a Shopping Cart in a class diagram, later on an E/R ...
4
votes
2answers
2k views

How should libraries be shown in UML class diagram?

Maybe the title isn't that clear so I will explain this a little bit further. I use biojava to perform BLAST searches. However this BLAST.jar contains a lot of classes: org/biojava/bio/program/...
11
votes
3answers
6k views

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 ...
-3
votes
1answer
1k views

Turn based game class design

I wrote abstract base for some turn-based games (like chess or tic-tac-toe) and wrote game based on this base. And I stuck with choosing how to design class hierarchy. Here is two variants for wich I ...
3
votes
1answer
498 views

Class Diagram - Inheritance Relationship

If in class diagram I have a parent "Account" and three childs "Child1", "Child2", and "Admin". The "Admin" has control over "Child1" and "Child2" accounts. Will the relation be like this?
3
votes
3answers
3k views

How to translate a class diagram to code?

During the design stage, I usually come up with a class diagram that looks something like this However, during coding stage, I would never create a class like Librarian with issueStatus() or ...
2
votes
0answers
364 views

Understand the service term in DDD and matching class diagram

I m trying to learn how to make my code better. This way, I try to learn some books and understand them. I m having some troubles dealing with Domain Objects. From the first year of my IT school, I'...
1
vote
1answer
2k views

How to represent two way composition between two classes in UML class diagram

If class A has many of class B and class B has many of class A, should we place a diamond on both sides of the line between them? Like in the picture below, or is it fine to just indicate the amount ...
1
vote
1answer
353 views

How does maven internally manage package dependency?

Can some let me know how does maven internally manages package dependency? Is there any architecture diagram available on the net for the same? I also asked this in Quora and maven user mailing list ...
1
vote
0answers
269 views

Shared pointers across threads in UML for class and sequence diagrams

How does one represent shared pointers across threads in UML for class diagrams and sequence diagrams? I especially want to document the ownership of the memory even though it's accessibility (a ...
2
votes
3answers
1k views

How to represent the following scenario in a class diagram?

Consider a store with multiple branches and a system generates reports for each branch monthly and annually and an overall report as well monthly and annually. So in total there are 4 types of ...
4
votes
2answers
1k views

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