dev90
dev90

Reputation: 7559

How to define Activity Intent in Class Diagram

I have an assignment to create UML class diagram of an Android project. I have successfully created most of the diagrams.

I got little bit confused when i was reading Activity code, I am unable to understand the relationship between two different Activites, that is created by intents.

kindly guide me how to create diagrams and define what type of relationship between 2 Activities. What i have understand is that, its not association, aggregation, composition or dependency, then what it is..Kindly guide me.

Upvotes: 1

Views: 1570

Answers (1)

qwerty_so
qwerty_so

Reputation: 36313

You will usually not link activities as such. One activity represents a scenario in a use case. There must be at least one sunny day scenario. But you can have various other scenarios which will mostly on constraints (a common constraint is e.g. {must be logged on} or the like). So the activities are independent.

However, you can use activities for structuring a single scenario. In that case you would link with a ControlFlow which is represented as directed connector with an open arrow pointing towards the next activity.

You can make a structured activity which itself consists of sub-activities. This is shown by the lying 8 in the right SubActivity2.

enter image description here

In your comment you ask how to link it in a class diagram. You can link activities to classes with a simple dependency (class depends on activity). It is no common to mix behavioral features like activities in structural diagrams like class diagrams. But UML does not forbid that and there might be reasons to use it.

Upvotes: 3

Related Questions