Question

I have 2 classes called PostcodeLookup and Address. PostcodeLookp has an operation called 'Search' which returns an array of type Address. I am not sure how to represent the relation using UML.

enter image description here

Can somebody suggest me which relation I should use and why. I read few articles on these relations but I am always confused. Also suggest a better source to understand UML.

Thanks in advance.

Was it helpful?

Solution 2

enter image description here

You can use both variants, at the second one you see the connection more easily, but on the other hand, maybe you don't want to make too many lines.

That relationship is called Dependency.

Definition of Dependency

A dependency is a relationship that signifies that a single or a set of model elements requires other model elements for their specification or implementation. This means that the complete semantics of the depending elements is either semantically or structurally dependent on the definition of the supplier element(s).

(VP UML help)

OTHER TIPS

You do not have to add any relation between PostcodeLookup and Address; you have to add a return parameter to your Search Operation which will be typed by Adress and that's all. This will implies a dependency from PostcodeLookup and Address but this dependency can be computed but not modeled as UML element.

Hoping it helps,

Regards, EBR

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top