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.

learn more… | top users | synonyms

5
votes
3answers
4k views

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? ...
5
votes
2answers
15k views

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 ...
5
votes
1answer
359 views

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 ...
5
votes
5answers
6k views

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 ...
4
votes
2answers
15k views

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

Java code generation from class diagram

I'm on the way developing a Java application where user can provide a class diagram and get the corresponding Java code. I don't know how can I let the user interactively draw a class diagram in ...
3
votes
3answers
687 views

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): ...
3
votes
5answers
1k views

What classes to put exactly in a class diagram?

What classes must I put in a class diagram? Only classes used in Business Layer and associations between them? Or also other classes in the Data Access Layer, Service Layer, etc.?
3
votes
1answer
353 views

Graph/diagram editor that works with pseudographics

Is there a graph/diagram editing tool that can output (or even better also parse) pseudographics, that can be easily inserted into source code comments? Like this: +---------------+ | ...
3
votes
1answer
173 views

How to draw a class diagram where a class contains either 6 other classes or mupltie different

I know the basics but do not how to model this (it is an exercise with no solution provided): An order can contain 1 or more cartons of beer. Each carton contains 6 beers of the same kind but ...
2
votes
3answers
154 views

How do I show 'creates' in a UML class diagram?

Let's say my code is going to look like this: public class MyController { private Foo foo; private FooGenerator fooGen; //setters public void work() { this.foo = ...
2
votes
1answer
1k views

UML representation of specific factory pattern

I have to create an UML class diagram from the following example code (Perl). I don't think that the standard factory pattern match in my case or I don't understand it correctly. I don't have ...
2
votes
1answer
2k views

What is the difference between UML Data profile and ER model?

I have been asked this question and even after a lot of research, I cannot find the answer. When I design a database using Entity relationship (ER) and then re-draw it as UML class model (extended ...
2
votes
2answers
217 views

How can I indicate if an object operates with another one in an UML class diagram?

Suppose I want to draw a class diagram of a DAO and an Entity. The DAO is used to load instances of the Entity from the database. How can I represent this relationship on my class diagram? Is this ...
2
votes
3answers
794 views

What to use in UML for included module in ruby?

I like to create simple class diagrams for my projects. Most of the time I just use composition, inheritence and associations. IMB's basic UML resource tells all about this. However I'm using ruby so ...
2
votes
2answers
638 views

Package diagram for an MVC patterned project?

We are required to make a package diagram for our senior project. Since our project uses MVC patter design, we created an MVC class diagram, now, our problem is in creating the package diagrams from ...
2
votes
0answers
143 views

UML diagram for an existing implementation

I have some code, which I want to present in UML, but I've stuck at one point. Let me tell you something about code's functionality. I have a workspace in which I can place some Components, select ...
1
vote
3answers
675 views

Should we include external systems in Class diagram?

I want to draw a class diagram that shows the following for an application: An external content management system that publishes some news items. The class that represents the news item in my ...
1
vote
4answers
3k views

best way to handle a many to many relationship?

I am drawing a class diagram and I want to know what's the proper notation for many to many relationship between supplier and product? Should I show the table created supplier_product or leave it out ...
1
vote
3answers
209 views

UML Class Diagram: How can I represent “orthogonal” generalizations (or multi-inheritence)?

I try to represent in a UML Class Diagram the following object and features: The Object: A System (e.g. an electronic device) that can be of Type A, B or C If the System is of type A, it has a ...
1
vote
1answer
246 views

Should dependency relationships always be shown on class diagrams

I recently started using the Object aid UML generator plugin for Eclipse and noticed that by default adding of dependency relationships is switched off. This made me wonder if in most cases they ...
1
vote
1answer
99 views

Inheritance vs Class Diagram [closed]

What is the difference between an inheritance diagram and a class diagram in UML? For the Computer Science A Level (a British test administrated by Cambridge University, so it's possible that this ...
1
vote
2answers
609 views

How show Attributes which appear In Many To Many association

As we know a many to many association are shown by two asterisks in both end of association. Now I have a association between two entities "Good" and "Invoice" so Good and Invoice have a many to many ...
1
vote
1answer
291 views

How to represent a multiple choice attribute in UML class diagram?

I'm modelling a Filter class that stores the options for filtering a search. Some of the attributes are multiple choice. For example, if you are filtering hotel rooms you have a Price attribute that ...
1
vote
2answers
184 views

Confusion about associations in UML class diagram

--------------------- ---------------------- | FLIGHT | | STEWARD | --------------------- ---------------------- | Arrival time | | Steward ID | | ...
1
vote
1answer
105 views

How to manage coupling in model classes

I'm doing a class diagram for a game project, but I'm stuck on a coupling problem. Context The projet is a turn-based game. Two users are playing. They've got units on a map. They play until 1 ...
1
vote
3answers
232 views

What alternative is better to diagram this scenario?

I was creating and discussing a class diagram with a partner of mine. To simplify things, I've modify the real domain we're working on and made up the following diagram: Basically, a company works ...
1
vote
1answer
58 views

UML diagram for attributes that can have two different types

I have been to an interview for a financial programming job, and I could not answer to one question for sure. I thought about it again, but I really cannot find a good answer. They asked me to design ...
1
vote
2answers
122 views

Can a UML class diagram show two different relationships between two classes?

I have a class which has an inner (nested) class. I have shown this relationship between the two classes in my class diagram. However, I am also using the inner class within the outer class... do I ...
1
vote
1answer
64 views

How to show link between a java class which gets JSON data from PHP script

I am trying to show the relationship that a java class has with a PHP script. The PHP script gets data from a database and then converts it into JSON format. This is then read by the java file. In my ...
1
vote
1answer
81 views

Finding methods of classes from the use case

I know some nouns in the use case scenario are candidate to be class, for example member, customer, student .... I can find such entities and some attributes of them, but my problem is that I can't ...
1
vote
1answer
402 views

UML class diagram - can aggregated object be part of two aggregated classes?

Some sources say that aggregation means that the class owns the object and shares reference. Lets assume an example where a company class holds a list of cars but departments of that company has list ...
1
vote
1answer
2k views

UML Class diagram confusion

I am learning how to draw a UML class diagram and after reading a few tutorials, I am still confused about the appropriate usages of Association type (The clear diamond and black diamond). I ...
1
vote
1answer
420 views

How would you go about creating a class diagram for a JPA/JSF application

I was creating a class diagram for an application I was working on today and I didnt include the JPA entities since I had all the information I thought was important in my DAOs, for example, I just ...
1
vote
0answers
71 views

MVC class modeling

I have following requirement and I am trying to design class diagram. This is the first time I am creating class diagram so I would like to get some advice from experts.. :) This is a simple login ...
0
votes
4answers
516 views

Does it make sense to generate java classes from class diagram?

As we do design & analysis before development, wouldn't be convenient to be able to generate Java classes from a class diagram? This would promote more exhaustive design and better codes, right? ...
0
votes
2answers
331 views

How to indicate that a class might implement an interface?

Say I have a class User and an interface Administrator. Some users are administrator and can thus implement the interface. Most aren't, however, so it's false to say that "User implements ...
0
votes
1answer
313 views

I want to draw class diagram, but I don't know how to put server and database inside? [closed]

I just started to draw class diagram, I think it is based on 3-tie architecture. I have mobile application, servers, database, and web interface. But I do not know if it should put the server in? I ...
0
votes
2answers
187 views

Subclassing to avoid line length

The standard line length of code is 80 characters per line. This is accepted and followed by the most of programmers. I working on a state machine of a character and is necessary for me follow this ...
0
votes
3answers
709 views

UML - Class Diagrams Order -> Products

I have a class diagram that is like this: < Order > (1) CAN HAVE (M) < products > But therefore Order has the following: Order_Id Customer_Id Order_date_day Order_date_month ...
0
votes
2answers
534 views

Different relationships between component and class diagram [closed]

How can I convert association of class diagram to component diagram? For instance what is the equivalent relationship of ->, aggregation and inheritance of UML class diagram to the component diagram? ...
0
votes
3answers
94 views

Should foreign keys be represented directly when mapping database tables to classes? [closed]

Ok, in my database I have a table Event and a table Room. Each Room can have many Event. Room table roomID-roomName 1 - cafe102 ... Event table eventID- Time -type -roomID 1 - 11:20 - 1 ...
0
votes
2answers
128 views

What kind of design diagram is this?

Here is a kata for the Bowling Game problem. Slide 9 (below) shows a design diagram. But its not obvious to me which box is a class and which is a property or method from the makeup of the boxes ...
0
votes
1answer
400 views

My UML class diagram is too complicated, what should I do?

Classes have 10-20 links with one another and you can't see anything in that mess of a diagram Unfortunately we finished coding already and if we change the class diagram we have to redo the whole ...
0
votes
1answer
2k views

Class Design and Structure Online Web Store

I hope I have asked this in the right forum. Basically, we're designing an Online Store and I am designing the class structure for ordering a product and want some clarification on what I have so ...
0
votes
1answer
44 views

Multiplicities and ternary relations in UML and ER

With entity–relationship diagrams, there are two conventions of denoting multiplicities, (I) and (II): Say, a teacher T is giving ‹G› some lectures L. Then we can either write this as 1 ...
0
votes
2answers
96 views

My class diagram needs to model a relationship with varying quantities

I am trying to design a restaurant ordering system in UML, which should also include the stock system. One of the classes is a Dish (i.e. a dish on the menu), and another is an Ingredient. My ...
0
votes
1answer
259 views

How would you draw this UML class diagram?

I'm currently trying to learn UML but I have trouble with this one. Lets say you have a container with cards, a container with players, and that player has also cards. How would you draw this in a ...
0
votes
2answers
214 views

UML Class Diagram: Abstract or Interface?

I am modeling a class diagram and have spotted an opportunity to simplify it slightly. What I want to know is, would this it be better to implement an abstract class or an interface? The scenario is ...
0
votes
1answer
3k views

Making Class Diagram for MVC Pattern Project

I have a question about making a class diagram for an MVC based college senior project. If we have 2 actors of users in my system, lets say Undergrad and Graduate students are the children of ...