Questions tagged [class-diagram]

UML diagram describing object classes and relations among them.

A class diagram is a component of the Unified Modeling Language decribing object classes in the object oriented programming paradigm :

  • What they contain (attributes)
  • How they behave (methods)
  • How they are linked together (dependancy)
1529 questions
10
votes
2 answers

How to visualize Protocols and Extensions in UML?

It seems reasonable to use UML Interfaces to visualize Swift Protocols in UML. But how should I visualize an extension that provides a default implementation for a specific protocol? Should I just use a class like <>ProtocolName that…
10
votes
1 answer

UML Class Diagram with Inheritance and Interface

I'm trying to understand how can I draw a UML diagram of a program that extends one class and implements another interface. I've made this sketch but I'm not sure if it is correct. A is a class that has some fields and methods and B is an interface…
azuosxela
  • 210
  • 1
  • 7
  • 15
10
votes
4 answers

In UML class diagram can composition be bidirectional?

Can composition be bidirectional in a way that both classes are aware of each other? And if not, what is the default direction of composition?
antifriz
  • 873
  • 2
  • 13
  • 20
10
votes
2 answers

How to represent Javascript object creation with an UML class diagram?

I'm having some trouble drawing an accurate UML Class diagram for my JavaScript APP. I've read several UML reference resources, but still didn't find an answer for my situation, since all the examples are based on the classical inheritance and class…
10
votes
3 answers

Representing a C# Generic Method in a UML Class Diagram

I have the following interface: public interface IRegisterable { T Register(string username, string passw) where T : User, ICanLogin, new(); } User is an abstract class, and ICanLogin is another interface. Now, I want to represent the above…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
10
votes
4 answers

UML: when one class have as method parameter pointer to other class

When one class have as method parameter pointer(or reference, or object) to other class, in UML it is reflected as association or aggregation, with diamond, or have some specific notation?
Alecs
  • 2,256
  • 8
  • 32
  • 45
10
votes
2 answers

How to show multiplicities in UML object diagrams

I wonder if there is way to create an array of objects in UML? the following is my try using Modelio as a modeling environment but as you can see there is different objects(i.e. instance[0],instance 1],instance[2],instance[3])
Andrew
  • 713
  • 3
  • 10
  • 19
10
votes
1 answer

UML diagram: How to show interface that is implemented by most of the Classes in my class diagram

I have a interface like: public interface MyEntity { //HIbernate version public long getOptLock(); //these method are used to keep track of Last modified timestamp public void update(); public void persist(); } Which is…
Rohit
  • 2,132
  • 1
  • 15
  • 24
10
votes
2 answers

Generation of Class Diagram from XMI

Situation I have a PHP project with lots of classes with lots of relationships in lots of folders following the Zend Naming Convention. I use the NetBeans IDE 7.1. I work under Windows 7. Goal I need to see a graphical representation of the class…
XedinUnknown
  • 677
  • 9
  • 25
9
votes
6 answers

Can class visibility be shown on UML class diagrams?

Class visibility is an important part of object design. I have not seen any example diagrams showing non-public classes in several UML books, nor have I seen a way to show class visibility in Enterprise Architect, among other tools. Enterprise…
9
votes
3 answers

Annotated Android Class Hierarchy

For the life of me, I can't see the "big picture". Every time I think I learned something about Android, a new class pops up in some sample/example code. True, I can look it up in the (terse) formal reference, but I need something additional: A…
an00b
  • 11,338
  • 13
  • 64
  • 101
9
votes
0 answers

Visual Studio 2015 error loading Class Diagram .cd file

I continually get this error while loading a Class diagram created in VS 2015 "Object reference not set to an instance of an object" (And the diagram doesn't show up!) Just a moment before the diagram was opening just fine !!! I have tried to remove…
spiderman
  • 1,565
  • 2
  • 16
  • 37
9
votes
2 answers

How do I represent a mixin/role/trait with UML properly?

Me and several other developers are currently cleaning up our legacy code base, mostly separating visual and data layers. To help developers not involved in this refactoring understand the model, I'd like to introduce a (rather informal) class…
Nikolai Prokoschenko
  • 8,465
  • 11
  • 58
  • 97
9
votes
1 answer

Representing Objective C Protocols on UML class diagrams

How should I correctly reference protocols on a UML class diagram? For example my ListViewController conforms to the UITableViewDataSource and UITableViewDelegate protocols... where do I put the cellForRowAtIndexPath or numberOfRowsInSection…
joec
  • 3,533
  • 10
  • 60
  • 89
9
votes
1 answer

Dia: straight line for association in class diagram

In Dia, by default (at least on Debian Wheezy out of the box) the lines representing the associations between two classes are not straight but follow the grid. Is there a way to make the association lines between classes in dia straight?
Iam Zesh
  • 1,797
  • 2
  • 20
  • 42