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.
183 questions
3
votes
1
answer
194
views
How should User behaviour depending on role be design as OOP
Imagine I got user which might be either author, administrator, reviewer
An author have relation on book that he wrote.
An administrator have relation on banned user (we track which administrator ...
7
votes
2
answers
1k
views
Creating sequence diagrams for use cases
If I create a sequence diagram for a use case, should the objects in the sequence diagram be based on the methods and classes in the class diagram, or is that not necessarily required?
1
vote
3
answers
224
views
Calendar modeling in class diagram
I am creating a cinema website focused on client services, where clients can reserve tickets for movies and browse the cinema's schedule (both daily and weekly). The schedules will be managed by an ...
0
votes
2
answers
141
views
UML: Association vs operation
I want model something in class diagram. sometime it seems you can use association or just operation. for example User and Product, should they have association with name Add or should class User have ...
1
vote
1
answer
111
views
Is it appropriate to include a "select all" function in a Class Diagram?
Background
Working towards my final project at University, team project and we're stuck with a disagreement on a point in our Class Diagram.
We have a class, called "Road".
In here with have ...
2
votes
2
answers
267
views
Help me clarify the cardinality for some concepts for a model
So I have a security model and am having problem with deciding the cardinality. This is what I have now:
Threat may result in Attack.
Direct Association
One-to-Many (0..*)
Attack exploits ...
5
votes
2
answers
3k
views
Associations and References in UML Class Diagram
Is it possible to have an association without explicitly indicating the reference attributes in the participating classes in the UML class diagram?
For example, consider this example :
We can see ...
0
votes
4
answers
423
views
Should I model constraints which are valid, but which have no current function in the domain?
When domain modelling, should a valid constraint - or "natural" constraint - be modelled, even if there are no current business processes which rely on the constraint being asserted.
As an ...
1
vote
1
answer
376
views
Design User Permissions
I'm building a ToDo list while practicing in different patterns and adding more complexity to the project.
The problem which I'm currently facing is to how to apply (and later use, validate and ...
2
votes
3
answers
225
views
Which association should be in the class diagram
there are a vehicle class and customer class . In short, in the customer class there is a function that shows 'can this person or company rent that car'.The function uses a object of vehicle and ...
1
vote
1
answer
182
views
Correct way to represent acquaintance enforced by interface in UML class diagram
Suppose I have the following client code:
using System;
namespace InterfaceCompositionUml
{
internal class Program
{
static void Main(string[] args)
{
...
-2
votes
1
answer
122
views
UML relationships
Could someone explain to me if the relation in this class diagram is a "dependency" or "association" relationship and why?
I cannot edit the picture. The terms translate into ...
1
vote
2
answers
269
views
What if the parent can't exist without a child? (Class diagram)
I've built a matchmaking system where two of the classes look like this:
I know that it actually looks like an inheritance, but in the code it doesn't extend to the PlayerInMatchmaking and the ...
3
votes
1
answer
278
views
GOF class diagram for Builder pattern appears to contradict its corresponding sequence diagram
In the Design Patterns: Elements of Reusable Object Oriented Software, the Gang of Four present the following canonical form for the Builder pattern:
In Appendix B the following is mentioned ...
1
vote
1
answer
133
views
UML Class Diagram Excersise
Problem statement:
The information system of a university must manage information relating to its employees, departments,
institutes, courses provided, and research projects.
Information relating to ...
0
votes
1
answer
214
views
I'm very confused coming from MYSQL, is it necessary to "connect" classes via matching IDs as attributes or are associations enough?
I'm making a class diagram for my school project, an Inventory Management System. So far, I've made the use-case and activity diagrams, however, I'm struggling with the class diagram and mostly ...
2
votes
1
answer
1k
views
UML Diagram double arrow
In a Microsoft Learn article on MVVM there is an, what I assume, UML diagram that didn't make sense to me. (https://learn.microsoft.com/en-us/archive/msdn-magazine/2009/february/patterns-wpf-apps-with-...
-2
votes
1
answer
2k
views
How to add methods in a class that uses other classes in UML class diagrams?
I have an index file that uses three main JS classes each defining one method. The JS application is about listing a folder datasets, deleting a dataset from that folder, or uploading a dataset from ...
1
vote
2
answers
515
views
How to deal with often repeated relations in UML Class Diagrams / ERM?
Suppose you have a ERM containing about 40 Classes / Entities. Most of them in quantified relations to others, some of them as standing there alone.
How to deal with a very often used relation/...
-1
votes
1
answer
204
views
Confusion with class diagram question
There was this question on my mock and I am just really confused about it. I tried to learn about class diagrams in more detail but there was no information that explained to the detail of the ...
1
vote
1
answer
268
views
UML arrowhead confusion
The answer to this question is A however I can't wrap my head around how there is a inheritance given the only information is the quote below (ie. a player is not a kind of team). It would make more ...
4
votes
2
answers
1k
views
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 ...
1
vote
1
answer
108
views
How to represent CDI interceptors in class diagram?
I have the following classes:
public class MyCaller{
@Inject private MyService service;
private void callerMethod(int arg1, String arg2){
service.serviceMethod(arg1, arg2);
}
}...
3
votes
2
answers
768
views
Where do methods in class diagrams come from?
In a class diagram, how do I know what methods to add? I’m not sure what the connection is between methods and other (i.e. Activity and User Case) diagrams. My guess is that methods can come from ...
-1
votes
2
answers
194
views
Is an abstract role needed to ensure that a customer can only have one role out of several? [closed]
I have the following UML class diagram in a C++ context. I want to make sure that a Customer can have only one role:
Can the Customer now only assume one role, and what does <<abstract>> ...
0
votes
2
answers
1k
views
ER Diagram - How to display relationships between Entities that are a type of another
I face a problem in understanding how this situation can be traduced to an ER diagram.
So I have an entity, let's call it car, and then, there are another entities, that are a type of car. For example,...
0
votes
0
answers
684
views
Drawing a sequence diagram for a "View posts in a section" use case
As title says, I'm currently working on an alaysis model for a little website similar to Reddit for academic purposes.
I have one use cases written like this (They're not in English so they may not ...
1
vote
1
answer
660
views
ECB and multiple similar views
My teacher told me that in the entity-control-boundary we need to create a boundary class for each view of mock-up but I can't really understand if this is always true.
For example if i have a mock up ...
1
vote
1
answer
86
views
Videotape copy as an attribute or Class
I am going over tutorials regarding class design; in one, a videotape can have multiple copies and each copy can be borrowed by a borrower. Please see figure A:
I am trying to understand why the ...
1
vote
4
answers
166
views
Class Diagram - Aggregating over a class that has physical presence or logical presence?
In the below figure, a CD shop has CD cupboards, and inside it has shelves. CDs could be rented, and class CD Copy represents the actual CDs that are rented. My question is, should I represent Shelves ...
1
vote
2
answers
266
views
Connecting classes by passing method references
I am trying to find a good way of allowing two objects that are separated by a intermediate object to communicate while keeping the architecture loosely coupled. A solution I have developed is to pass ...
-2
votes
2
answers
279
views
OOP: How to Manipulate Objects Using ORM Techniques?
about those objects and arraylists inside the classes, derived from one-to-many relationships, using the ORM techniques, what's the best way to deal with them at the time of setters and validation ...
-2
votes
1
answer
757
views
Should customer class have the different function or should i include it in account class in my UML class diagram of banking system?
Should i include the different functions of open account, close account , withdraw in the customer class(as shown in the picture) or should i include it in the account class
0
votes
1
answer
1k
views
Appointments using time slots
I would like to create a dynamic appointment system between teacher and student to easily allow them to make an appointment.
In this system, teachers select their 30 minutes time slot availabilities ...
-2
votes
1
answer
1k
views
Appointments Booking Using Slots
I'm looking for an efficient way to create appointments between teachers and students.
I want teacher to be able of make their students know their availabilities : For example, A Teacher writes on the ...
0
votes
1
answer
657
views
Confused over qualification association in conceptual schema UML
I am getting confused at qualification association. I perform qualification when I need to remove many-to-many relationship or when the PK of a particular table is not able to be uniquely identify a ...
1
vote
1
answer
663
views
How to represent association classes in a UML component diagram?
Please consider a class diagram and a component diagram as shown below. In the class diagram I use association classes to represent the relationship between two classes (BaseLink and ShoulderLink) as ...
-1
votes
1
answer
234
views
Designing a class implementing a method which signature types depends on the instance contained
My goal is to define a Service class which process method accepts a RequestType argument that is defined by the contained ServiceType and returns an object of a type defined by ServiceType. By doing ...
-2
votes
1
answer
222
views
Achieving loose coupling
My scenario involves the following classes:
I have three types of Peer that creates a RegistryType instance because its methods are needed. Same for Identity class. Each PeerType need 0 or all the ...
-1
votes
1
answer
81
views
Model design for `Team`s and `Member`s
Say we have to create a model for a company, where employees can be part of many different teams.
A team can have member members.
Members can be part of many teams.
How to design database tables for ...
2
votes
2
answers
2k
views
How to model relations in UML Class and Object diagram for simple Graph structure
I'm trying to model a simple Graph structure as an UML Class Diagram and Object Diagram. A Graph can have multiple Nodes and knows it's starting Node. Every Node has a predecessor and a successor Node....
3
votes
2
answers
1k
views
How to design correctly relationships of class diagrams?
I'm learning OOP so I decided to start a new project, a chess tournament manager.
Here you can read about chess tournaments https://en.m.wikipedia.org/wiki/Chess_tournament
Basically the user will be ...
2
votes
6
answers
3k
views
UML: what is the correct order of steps?
I was reading an old text book "Beginning C# Object oriented programming" from 2011. The author in one case employs the "use case" to identify classes and then goes to draw a class ...
0
votes
1
answer
2k
views
Inheritance and association relationships in UML
I was creating a class model using inheritance, and have a situation I don't know how to represent.
For this question I built an example diagram in which I have a class Person with some attributes.
I ...
0
votes
0
answers
3k
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
0
answers
440
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 ...
4
votes
1
answer
93
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>...
7
votes
1
answer
3k
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
1
answer
2k
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
2
answers
451
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 ...