Android类图UML [英] Android Class Diagram UML

查看:416
本文介绍了Android类图UML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Android项目创建一个类图。
我希望我的类代表我将实现的活动,服务和接口。



在网上有几个问题,但我不能找到一个确定的答案。



我知道Android和UML没有特定的规则,但我有一些疑问。




  • 如何表示活动和AsyncTask之间的关系?

  • 如何表明活动对另一个活动有意图?



也许如果有人有一个例子,会有帮助。

解决方案

也许这样吗?






  • MyBackgroundTask IS A AsyncTask

  • MyActivity IS A 活动 li>
  • MyActivity HAS ONE MyBackgroundTask



您可以使用依赖来显示 AnActivity 类和 AnotherActivity 类:





在这种情况下,它意味着 AnActivity 类需要 AnotherActivity 类的规范或实现。



另一个例子是: :




  • MainActivity IS A FragmentActivity

  • MainActivity HAS SOME fragment 碎片的类型为 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 A AsyncTask
  • MyActivity IS A Activity
  • MyActivity HAS ONE MyBackgroundTask

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 A FragmentActivity
  • MainActivity HAS SOME fragments. The fragments are of type String.

这篇关于Android类图UML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆