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.
139
questions
-1
votes
1answer
21 views
How important is abstraction in a class diagram?
Could someone please elaborate on what exactly abstraction is and why do we need it in a class diagram, trying to model the problem domain? I have read many articles from various websites and academic ...
0
votes
0answers
62 views
Class diagram of an Hotel Management System
I am given the following system description :
Consider a hotel
management system to manage a group of 5-stars hotels. If this system is modelled using OOP methodology, and the classes are identified ...
0
votes
0answers
46 views
Could you help me understand what a problem domain is and how can I build my class diagram based on it?
So I just started studying Software Engineering because I am really interested in it and my professor in London asked us to create an app which is like Instagram (only theoretically, without the ...
3
votes
1answer
33 views
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:
[<visibility>] <name> ‘(‘ [<parameter-list>...
4
votes
1answer
100 views
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 ...
1
vote
1answer
61 views
(UML) Can parameter variables be omitted in a lengthy constructor?
I have the following constructor in a class for a code I'm writing an assignment on for school:
public Plant(int xPos, int yPos,int width,int height, int hp,String imageLocation,String audioLocation,...
-1
votes
2answers
67 views
How to represent hierarchy in a use case diagram
I need to finish a task in my homework. I need to include a use case diagram. I have the following situation I have a master, admin, manager, seller and attendant users. It is like this, master is the ...
-2
votes
2answers
100 views
Can I make a separate use case and class diagram for each module?
I'm working on a project with 5 different modules. Should I make separate use case diagrams and class diagrams for each module or should I make all-in-one use case diagram and all-in-one class diagram?...
-5
votes
1answer
276 views
Use Case Diagram for Vending machine
I want to create a use case diagram for a vending machine which has the following states:
Accepts coins of 1,5,10,25 Cents
Allow user to select products Coke(25), Pepsi(35), Soda(45)
Allow user to ...
2
votes
2answers
63 views
Consider as a single class or attribute/operation of existing class?
There are different methods for recognizing classes in UP methodology:
noun/verb analysis
using CRC analysis
using RUP stereotypes
other sources
I have read above methods fully detailed in UML 2 and ...
-10
votes
1answer
75 views
Find design issues via a class diagram? [duplicate]
Given a class diagram , how can we find design issues in it. I am not talking about the relationships it should be representing as they exist in the real world but i am talking about design issues ...
0
votes
3answers
186 views
How to find design defects by using a class diagram? [closed]
What are the design defects that can be spotted by using a class diagram, and how?
I am not concerned about syntactical/ representational defects, but in things like the following:
Do the classes/...
-2
votes
1answer
121 views
Class diagram for permissions
I have this class diagram exercise in UML. The main problem was the permissions are the works, which I did not know very well how to model it. The specification says:
Users can publish their work ...
0
votes
0answers
125 views
Android : How to represent one activity starting another activity with an intent in a UML sequence diagram and class diagram?
In this simple example I have two activities ActivityA and ActivityB.
ActivityA is the foreground activity. User clicks a button that executes dispatchActivityBIntent() that creates a intent and ...
2
votes
1answer
175 views
How to visualise multiple similar classes in an UML class diagram?
My question is about an "edge case" of the UML class diagram. In particular, I have loads (about 30) classes that implement an interface. They can be split into two groups of similar classes. Within ...
1
vote
2answers
87 views
Class-diagram dependencies between classes
Can requirements be expressed in class-diagrams?
For example:
A student can enroll in a class.
There are different classes.
Some classes have dependencies, e.g. you can't go to Spanish III before ...
1
vote
2answers
142 views
Combined Inheritance and Composition
Let's say you have a wireless network that acts as a bridge/wireless repeater. How would both factor into a class diagram? In my mind it makes senses to have a parent object that can exist on its own. ...
3
votes
1answer
337 views
How can I provide a class diagram for a system that contains creation of an object that contains a combination of property?
I am designing a system that contains organizational hierarchy management. There are four roles in the system which are the user, admin, manager and head of procurement:
I am trying to let the ...
-4
votes
1answer
269 views
Where to put the server in my Messaging System UML diagram?
I try to design a client application for a messaging application. The client can send and receive messages, the client can connect/disconnect.
My problem is that I don't know how to incorporate the ...
0
votes
0answers
56 views
CK Metrics - Lower Complexity by Refactoring
I'm suppose to identify 3 CK metrics and the most appropriate class to refactor so as to increase encapsulation, modularity and reduce the complexity of the following project
According to my ...
0
votes
2answers
741 views
What is the difference between a qualified association and an association class and how to choose between them?
In UML 2.0, there are two ways of representing an association between classes which I can't seem to distinguish between.
First of all, there is the qualified association, represented as such:
You ...
-1
votes
2answers
312 views
Needs to understand the difference between boundary, controller, logical class types
As the title implies I am trying to understand the difference between boundary, controller and logical class types, which are used in the MVC pattern.
I will do so using an example. Please consider ...
3
votes
6answers
316 views
UML aggregation: how can the “whole” exist without its “parts”?
I understand aggregation is a "whole/part" relationship, where the "parent" class is the whole and the "child" class is the part (and this is unidirectional), and that each class exist independently (...
0
votes
2answers
183 views
Simple Poker Simulation - How to design it well
I trying to create a little poker Texas Holdem simulator ..
In my solution have some class :
Premise : I know about Fisher Yates algorithm.
I will implement it later
Keep in mind that the next ...
3
votes
2answers
199 views
How to improve this class diagram of a system with its components
So I was given a task of making a class diagram for a bicycle. I know what a class diagram is and the concepts behind one.
The requirement is that the bike can brake, turn or speed up. Now to me, a ...
2
votes
3answers
466 views
Is it possible to omit things in the class diagram [closed]
I'm writing documentation for a school java project I'm working on. Basically have chunked most of the methods into the class diagram, but now it seems very unreadable on a pdf as the words are too ...
-1
votes
2answers
2k views
is my UML use case and class diagram correct? [closed]
So I am very new to creating design diagrams. I have a scenario where a user who is an admin of pizza hut selects registration option and the system prompts them to enter customer details.
Upon ...
0
votes
1answer
738 views
Navigation in Class Diagram
I know that associations in class diagram can be bi-directional or directional. We refer to this as navigability. I am not sure to fully understand what it means.
Please consider the following ...
-1
votes
3answers
150 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
79 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
189 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
183 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 ...
1
vote
1answer
449 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 ...
-1
votes
1answer
181 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
416 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
174 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 ...
1
vote
4answers
424 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
569 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
62 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 ...
2
votes
4answers
163 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
217 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
467 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
169 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 ...
-1
votes
1answer
2k 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
153 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
226 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
1k 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
578 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
1k 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?
...
2
votes
2answers
1k 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 ...