Android类图UML [英] Android Class Diagram UML
问题描述
我想为Android项目创建一个类图。
我希望我的类代表我将实现的活动,服务和接口。
在网上有几个问题,但我不能找到一个确定的答案。
我知道Android和UML没有特定的规则,但我有一些疑问。
- 如何表示活动和AsyncTask之间的关系?
- 如何表明活动对另一个活动有意图?
也许如果有人有一个例子,会有帮助。
也许这样吗?
-
MyBackgroundTask
IS AAsyncTask
-
MyActivity
IS A活动
li>
-
MyActivity
HAS ONEMyBackgroundTask
您可以使用依赖来显示 AnActivity
类和 AnotherActivity
类:
在这种情况下,它意味着 AnActivity
类需要 AnotherActivity
类的规范或实现。
另一个例子是: :
-
MainActivity
IS AFragmentActivity
-
MainActivity
HAS SOMEfragment
。碎片
的类型为String
。
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.
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 the AnotherActivity
class:
In this case, it means that the AnActivity
class requires the AnotherActivity
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
.
这篇关于Android类图UML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!