Please click here to see my UML diagram
So I know this diagram is really wrong. But I honestly don't know how to express my ideas using UML notation and it is hard to find resources to this very specific case. basically I have these questions
After the customer entered his or her details, the
Arrangement
class will calculate the cost and the distance based on the info. (Using that information as the input) In this case, is it ok to usecalCostAndDis (Customer) : (int)
for the function bit?When I use an arrow and say "has access to", by that I want the variables in one class to be accessible by the other class, meaning the other class contains the those variables. For example, after a customer makes an order, the info will be saved to the CarsRecord class. So that later we can check the info in the record. How can I express it in UML notation? A class stores the info of another class?
If I want the
SystemRecord
to contain bothCarsrecord
andChauffeursRecord
, (meaning it has access to both of them as they are part of the system record). Does my graph express this idea correctly?
I am really sorry but I am desperate. I have spent days trying to understand class diagrams but I cannot find anything that explains this kind of situation.
Many thanks in advance.
-
1it looks like there's some additional confusion because it looks like you're trying to model use cases too (like customer has access to cars record)user7433– user743301/13/2017 17:39:17Commented Jan 13, 2017 at 17:39
-
Nothing to do with UML, but giving access to class internals to selected classes is not a nice design idea: the class members should be either public, or private (or protected) but not visible to some, depending on needs. This would quickly become unmaintainable (and would obfuscate UML diagram by requiring 2 links: an association and a friend dependency)Christophe– Christophe01/17/2017 06:38:08Commented Jan 17, 2017 at 6:38
1 Answer 1
First of all, there are many good resources out there. Try Google with 'UML class diagram' and you will be having tons of information. You may start with Wikipedia's page for UML class diagram or MSDN reference of UML diagrams.
Now, let's come to your specific questions:
- Whenever you wish to describe control flow of a program, you use sequence diagram.
- You may take a look at the standard 'relationships' (such as association, aggregation, and composition) between two classes.
- What you are looking for is a 'composition' relationship (which can be shown by a rhombus) but you are showing currently an inheritance hierarchy.