I have below a UML diagram for 3 modes of a camera:
SensorManager
class and other modules.SensorManager
class and other modules.SensorManager
class only.Can you please help me how to show that in UML diagram? I tried the following, but one might get confused thinking that record mode of camera needs SensorManager
class and other modules while it only stops at SensorManager
class.
Well, you somehow mix things that do not belong to each other. You show an activity diagram which is meant to illustrate actions that are part of an activity representing an aspect of a use case. Thus the text in the rounded rectangles (being actions) must describe some action. This is usually done using subject/verb/object constructs. The decision diamond responds to the outcome of the previous action and routes the token (control flow) to the according path. The guard that will let pass the token is written in [
square brackets ]
.
So once you have described the business flow you can start with constructing a static view of the target system. That is a number of classes and how they are associated. You can guess that this goes into a class diagram. Here some of your Manager
s will appear (where any manager name part is, so to say, superfluous).
Once you have that you can start creating collaborations where you look at (parts of) your activity diagram(s) and show how the various classes communicate to fulfill the task which is behind the collaboration. Here you usually create a sequence diagram.
The above is only a nutshell and not the whole picture. There are tons of books out there. E.g. the Rational Unified Process (a monster) and other process guides. I for myself started with the ICONIX model which is lightweight but got me on my feet rather quickly. It's up to you, but without thorough studies you won't make it. Takes a lot of time...