2

I've been developing an Android app for a while but I didn't start with any particular diagram. And now comes the time to do some real diagrams but I don't know how. Not because I'm not familiar with UML but because of Android and it's components.

For example, my app requires that the user needs to be logged in in order to see a menu. From there the user can choose the options he wants. The user can also do his registration.

Although this might be a silly and simple example...The point is...I didn't use any class named "Person" with getters and setters; or any class named "Request" with getters and setters and other methods. My app use classes like "Login.class", "SignIn.class", "MenuActivity.class", "HistoryActivity.class".

My question is...how do I use UML for an Android app? I mean I can't have a conceptual model diagram that says "Person"-----"Request", right?

Thanks in advance.

BlueHatCoder
  • 87
  • 1
  • 2
  • 7
  • 1
    Maybe a concept model would guide you in refactoring what sounds like procedural code into OO code. The getters and setters have nothing to do with this. Having classes that reflect the real world does. – Jim L. Sep 16 '15 at 00:03

2 Answers2

1

I think you are confused with different types of UML diagram types,

There are,

Structural UML diagrams

  1. Class diagram
  2. Package diagram
  3. Object diagram
  4. Component diagram
  5. Composite structure diagram
  6. Deployment diagram

Behavioral UML diagrams

  1. Activity diagram
  2. Sequence diagram
  3. Use case diagram
  4. State diagram
  5. Communication diagram
  6. Interaction overview diagram
  7. Timing diagram

And more, I think you are talking about Class diagram. Since class diagrams are technical and are targeted for the development team, It is totally fine to have all these Login.class, SignIn.class, MenuActivity.class, HistoryActivity.class in your class diagram.

But you can use conceptual things like Person, Request ect in your other UML diagrams (eg Use Case). because in these diagram this is targeted for many users not just developers, So using MenuActivity does not make any sense. Using conceptual entities is the way to go here.

Good luck

diyoda_
  • 5,274
  • 8
  • 57
  • 89
  • Yes, I meant Class diagram. So if I understood I can use those conceptual terms (Person, Request) even if they aren't any classes with those names at all...they are used as an example right? But using a Class diagram as an example I would need to tell what would be the operations (aka methods)...how do I do? Do I give real examples based on real classes or do I tell what the operations would supposedly do? – BlueHatCoder Sep 16 '15 at 00:46
  • No you should not use the classes that are not classes. If you want to include Person, Request entities in your class diagram, you should have then as classes in your code. As I said earlier, the Class diagram is for the developers not to the stake holders. This will help developers to communicate. If you are craving to have person and request entities. Use a use case diagram or sequence diagram. – diyoda_ Sep 16 '15 at 01:37
1

Your example suggests that you're trying to capture a some sort of use case. In this case you may need an activity diagram to demostrate the higher level view or a communication diagram if you're more concerned with more detailed one.

UML isn't concerned with programming languages, platforms and so on. Its main purpose is to provide a notation which can be used to communicate ideas without necessarily getting into too much details. So the first thing you need to consider is why you need diagrams in the first place and what you want to communicate with them. Given these questions answered it will become clear what kind of diagrams you need.

There is such thing as "4+1 model" which aims to separate the software model into several views. These views show different aspects of the software and concerned with different levels of detail. In Unified Process, for example, it is adviced to model from "top" to "bottom" of the solution, from high-level overview of use cases and main features to the actual implementation details. UML supports that providing different types of diagrams as well.

So if I understood I can use those conceptual terms (Person, Request) even if they aren't any classes with those names at all...they are used as an example right?

You indeed can, but not in diagrams with low-level features like Activities. You may want to build a domain class diagram that will include Persons and other entities relevant to your application, but won't be really represented in code.