Use functions of a class by after including third class

Monday, July 7, 2014

Sorry for the naming of the title because I don't know how to name this situation. There are three classes A, B and C. Class A need the function of class C. Class B is an instance collection of class C. So the operation should be class A calls the static method of class B to get the instance of class C.



//in class A
Class C = B.getCInstance("[instance name]")
C.doSth();


Then what is the relationship between class A, B and C in UML? When I draw a UML class diagram, should I need to build all of the relationship between A, B and C? for example: A class A uses a class B. A class B has A class C. A class A has A class C.







http://ift.tt/1mpSbPS