i have a calculator class and a main class. If i were to create a calculator object inside the main class, it would be … “main class has a calculator” main<–calculator. However, if i call method functions calls from calculator class inside the main class, how will this look/be (since im not creating an instance of calculator, is there any relationship between these two)?
Share
If your main class calls a method on calculator, but doesn’t create, own or keep a permanent reference to the calculator, the best way of describing the relationship between them might be “Dependency”.
See the section title “Dependency” on this wikipedia page:
http://en.wikipedia.org/wiki/Class_diagram
To the right of it is a picture depicting a visual representation of “dependency” — note the use of the word “uses” on the arrow.