android - How to represent the call to a class through another class using an UML Class Diagram -
in android, let's have 2 classes have common methods starting service, extract them helper class:
the following diagram shows strange attempt represent it. have used transaction narrows. think activity diagrams, in uml-diagrams.org/class-reference.html, narrows called association navigability. that's why have used them try represent diagram. between helperclass , classservice have used normal association. between classes , service have used restriction (it informative, make more clear):
am mixing class diagram activity diagram?
update 1: attempt represent component diagram:
note: favourite explanation of how use component diagram this: https://www.ibm.com/developerworks/rational/library/dec04/bell/
update 2: attempt draw class diagram suggested changes:
update 3: full class diagram. transaction arrows have been changed associations. user , system interactions have been removed (e.g. startswhenclick starts; startswhendetection starts):
yes, mixing processes , structures. class diagram structure diagram, no processes shown here, mere dependencies. can use dependency <i> instantiating, means 1 class needs other , for. yes, bit processes, class diagram structures.
cooperation of android components (activities, services, etc.) should shown component diagram, not class diagram. there can draw, messages sent, call whom , on. class diagram more thorough analysis. can use classes in component diagram, too. don't forget show, component class belongs, have forgotten here. use nesting/containment relationship this.
and on arrows activities use word "click". aren't trying describe ui here? 1 more diagram. there no standard diagram ui planning, advice use of class diagram elements it. not class diagram, ui diagram, uses class diagram elements.
as class diagram:
you can draw dependencies activities service. such info, starts, stops , on, on notes in class diagram, or, if not absolutely necessary, move activity diagram.
on association helperclass - classservice multiplication on target side should 0..1. service not there, it?
launcher bad stereotype. better give name launcher class , if think doesn't explain situation, anchor note it.
relationships of activities classes not defined.
so, seems, have tried put 4 diagrams in one. never work. divide them or @ least, clean 1 you've chosen. , if choosing, 1 diagram do, choose component 1 - common , useful.
edit: how show class included in component - 2 ways. can include class component , can connect them nesting relationship. both ways equivalent in content sense.
Comments
Post a Comment