On this webpage which shows how to draw a class diagram, why is the arrow for association pointing from order to customer, and not from customer to order?
相关问题
- What uses more memory in c++? An 2 ints or 2 funct
- How Does WebSphere Choose the Classloading Order i
- System sequence diagram - Can system request input
- Does Visual Studio 2010 Professional support UML m
- Store data and global variables using the Applicat
相关文章
- NameError: name 'self' is not defined, eve
- .NET - how to make a class such that only one othe
- Issue creating ImmutableMap with Class<?> as
- Create image of Neural Network structure
- How to return new instance of subclass while initi
- C++ increment operator
- Code Iris plugin on Android Studio
- Python object containing an array of objects being
Association ends have a boolean navigability property in UML. In this case, the navigability in the direction order to customer is set to true while the navigation in the direction customer to order is set to false.
With this, the designer of the model expresses that orders now who is the customer associated with the order but customers do not have direct access to their orders.
If we look at the Java code for this model, navigability it is easier to understand. For this example, this navigability means that Order has an attribute of type Customer but Customer has no collection attribute to store his/her orders
Its because an order "has a" reference to a customer.
In a database, this would be a foreign key in the order-table, which stores the customer-id.
In code, you would store a reference to the associated customer object in an order object. So the order is pointing to the customer and not vice-versa.
The arrows describe navigability.
Taken from: http://www.uml-diagrams.org/association.html
The arrows describe the ways you can navigate. So in this diagram you can go from order to customer. And for the other way: no arrow means NOT "not navigable", but "no comment". There is no definite right way to do it.
Possibly because an order is associated with a customer? These kind of things can be seen as working either way, or sometimes both.
This might help:
UML Class Diagrams: Guidelines: http://msdn.microsoft.com/en-us/library/dd409416%28VS.100%29.aspx
Properties of Associations in UML Class Diagrams: http://msdn.microsoft.com/en-us/library/dd323862%28VS.100%29.aspx
alt text http://i.msdn.microsoft.com/Dd323862.UML_ClassProp(en-us,VS.100).png