I'm trying to create a class diagram for an android project.
I want my classes represent the activities, services and interfaces that I will implement.
There are several questions about it on the web, but I couldn't find a definitive answer.
I know that there aren't specific rules for Android and UML, but I have some doubts.
- How can I represent the relationship between an Activity and a AsyncTask ?
- How can I indicate that an Activity has an intent to another Activity ?
Maybe if someone has an example, will really help.
Best Answer
Maybe something like this?
MyBackgroundTask
IS AAsyncTask
MyActivity
IS AActivity
MyActivity
HAS ONEMyBackgroundTask
You can use a dependency to show that there is an relationship between the
AnActivity
class and theAnotherActivity
class:In this case, it means that the
AnActivity
class requires theAnotherActivity
class for its specification or implementation. Also, use notes to make it clear.Update:
Another example:
MainActivity
IS AFragmentActivity
MainActivity
HAS SOMEfragments
. Thefragments
are of typeString
.