2

enter image description here

This is embarrassing, I apologize for not including the diagram image ( I thought I included it, but I should be more careful and verify it in the post )

I know almost nothing about UML, but to my knowledge an arrow with hollow head represents inheritance relationship ( ie ANDSpecification class inherits from CompositeSpecification class ), while the other type of arrow tells us we can navigate from ANDSpecification to CompositeSpecification?

a) But why does the diagram connecting ANDSpecification and CompositeSpecification contain both types of arrows? Perhaps because in addition to ANDSpecification inheriting from CompositeSpecification, it also has a property of type CompositeSpecification?

b) What is the meaning of numbers next to arrows?

Muhammad Hani
  • 8,476
  • 5
  • 29
  • 44
user437291
  • 4,561
  • 7
  • 37
  • 53

1 Answers1

6

First of all, could you please provide the source of your class diagram implementation, your inputs are not clear enough to determine the realtionships between the classes.

  • (A) There are two types of arrows, the arrow with a rectangular head describes "Generalization".

The specific classifier inherits part of its definition from the general classifier. The general classifier is at the arrow end of the connector. Attributes, associations, and operations are inherited by the specific classifier. Use the Inheritance tool to create a generalization between two classifiers.

  • The second type of arrows describes "Association"

A relationship between the members of two classifiers. There are two types of it, Aggregation and Composition.

  • (B) The numbers beside arrows simply describes "Multiplicity"

Multiplicity of an association end is the number of possible instances of the class associated with a single instance of the other end.

  ┬─────────────────────────┬───────────────────────────────────────────────────────┬
  │  Multiplicities         |      Explanation                                      |
  │                         |                                                       | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼
  |0..1                     | zero or one instance.                                 | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼
  |0..*  or  *              | no limit on the number of instances (including none)  | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼
  |1                        | exactly one instance                                  | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼
  |1..*                     | at least one instance                                 | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼

You can find helpful examples in the links below.

Explanation of the UML arrows

http://msdn.microsoft.com/en-us/library/dd409437%28VS.100%29.aspx

http://edutechwiki.unige.ch/en/UML_class_diagram

Community
  • 1
  • 1
Muhammad Hani
  • 8,476
  • 5
  • 29
  • 44
  • A - Are you certain those numbers specify multiplicity? Values used for multiplicity are *, 0 and 1, while one of the numbers in the diagram is 2?! B - "please provide the source of your class diagram implementation, your inputs are not clear enough to determine the realtionships between the classes." It's taken from DDD:Tackling Complexity in The heart of software. – user437291 Jan 25 '13 at 21:54
  • @user437291 The numbers aren't restricted to zero one and many! It is saying that an `OR Specification` refers to two other specifications, in either order, presumably as it is satisfied if either of the two is satisfied. Personally I would have designed it as 2..* so you don't have to have extra `or` steps if you have a choice of more than two specifications - having a fixed number which isn't 1 is very often a design smell. – Pete Kirkham Feb 02 '13 at 13:53