开发者

UML: How to Model UI and Background-Threads for Mobile Application (iPhone/iOS, Android)

Th开发者_JAVA百科ere are some Topics on Stackoverflow already related on how to model different Threads in UML, for example: Is there an inituitive UML approach to depict threads.

However I still feel, that my case has not been already discussed, even though it should be pretty common:

I am creating an iPhone Application, where I am obviously have a Main-UI-Thread and I am also using Background-Threads to perform Remote-Calls, etc. I basically have 4 different aspects that I like to display within my diagramm:

  1. The UI that is shown to the User.
  2. The Tasks that are being performed by the Main-UI-Thread (therefore blocking the UI)
  3. The Tasks that are performed by Background-Threads
  4. Updates of the UI, which are performed by the UI-Thread, but can be triggered by Background-Threads. For example: new Information loaded from Server, which needs to be displayed on the UI

Has anybody ran into a similiar issue and therefore might show me an example or give me some best practises on how to solve my problem? I am not even sure if I should use a sequence-diagram, an activity-diagram or maybe even some other type.


Well Pascal,

This is not an UML question. It is a design question.

UML just helps you

To understand hard and crtical section of your program/design and to explore alternative solutions , while writing your code. with the power of visual modeling.

So..

First, ask yourself what kind of parallelism or concurrency exist in your problem? To investigate this:

Draw a simple activity diagram with partions in which each partions used to represent different operating system threads or processes.The object nodes can be used to model the shared objects and data.Forking can be used to model the creation and parallel execution of multiple threads or processes.

Then ask yourself(using that diagram)

What are my shared data? What are my active classes? (threads)What kind of "concurency" problems" may accour? What may go wrong? What are synronization points? etc..Based on this Explore different alternatives, designs.

The last thing you should worry is UML and its sytax(symbols).

The best UML diagrams are the one that wake up the desire of "asking question" in your mind.

At first forget about Uml. Ask core questions about your problem. If you like visual modeling and your mind like visual thinking use Uml for better understand and investigate possible design solutions.

UML can not design for you...


I found this research papers while searching for same thing

M-UML: an extension to UML for the modeling of mobile agent-based software systems

May be it can help you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜