modeling - UML - How to show a class instantiated by its static main method -
it sequence diagram howto question, not howto code.
i using visio 2010 , developing >> reverse engineering microsoft dynamics ax 2012 / x++. yes people how map static on uml.
my class instantiated form using @ void static main(). calls static method, construct() returns instance of same class.
i want show class (in static methods) , resulting object separately meta class runs (self msgs) , produces class object takes over. how self msg call return value ? how connect resulting object of class ? hope make enough sense make guys understand.
note, class not static class, has static constructor.
if want depict call constructor (i.e. static operation responsible creating object , (usually) returning reply) have use createmessage construct i.e. dashed line open arrow , word create on it. while not directly stated in specification, in such case arrow points on lifeline box (rectangle) rather line (however i've seen information both notations correct).
note in case logic of constructor hidden (encapsulated) idea in general. can find more details in uml specification in section 17.4, 17.4.4.1 , example in section 17.6.5 on figure 17.14.
if want use static operation other constructor , call without use of class instance have model class object (after class is object @ least on analytical level). note type of message can either synchronous or asynchronous depending on needs.
with approach can provide details on how class handles function (i.e. other calls make). more details see "applied uml , patterns" craig larman, section 15.4, figure 15.20. note larman suggest use of <<metaclass>> stereotype. yet called object class (metaclass class instance class not our case) stereotype should <<class>>.


Comments
Post a Comment