Should user interfaces be included in the class diagram and sequence diagram?
Asked Answered
G

3

8

I have a project and I'm required to produce the class and sequence diagram. It is a procurement website. My only problem is that I don't know how to associate the web pages (user interfaces) to these diagrams. If they are not needed what is the right way for me to include it in the diagrams because from a book I read there are "UserInterface" classes, so another question, what should be inside of these UI classes.Can someone give me an example. Thanks!

Getupandgo answered 18/2, 2014 at 6:52 Comment(1)
yes also in the book titled "Systems Analysis and Design" they are described but not shown how to be used.Getupandgo
P
5

There are several levels of abstraction for UI modelling.

  • Use cases and state machines. These diagrams are made in human terms.
  • Planning on the server/page/frame level. Here UML deployment and component diagrams are useful.
  • Planning of the content of UI, defining elements and functonalities and connections between them WITHOUT choosing the concrete components. No standard for this, extremely important, stage. Use diagrams that you like. Class ones are usable, but in not standard reading.
  • Planning of the content of screen elements WITH choice of the UI components (frames, buttons and so on) and connecting functionalities to them. On this level you can use class and sequence diagrams.
  • Drawings of the planned screenshots. For this level there are no UML diagrams. And a common standard doesn't exist.

These levels require MANY diagrams. The lower the level, the more diagrams it needs. Putting user interfacES into one class diagram is possible for a minuscule project, but you can't say it SHOULD be done so.

Purposely answered 18/2, 2014 at 7:42 Comment(6)
It's not true that there is no standard for "Planning of the content of UI". The new Interaction Flow Modeling Language (IFML) can be used for exactly this purpose.Time
@gwag UML is a international and inter-company standard. I know that for the subj. there are some MS standard and some others. But they are not universal standards.Purposely
@gwag The IFML specification is currently in Beta version.Purposely
Like UML, IFML is an OMG standard.Time
@gwag They say it, yes. And they say also that it is Beta. What is a use of beta standard not supported by anything? Their "IFML open source project" simply won't run at all. So, for now it is better to use some functioning diagraming tool, as I have said.Purposely
@gwag I desire for some working tool for UI planning. But I have to use class diagrams yet.Purposely
T
3

In your class diagram you will normally describe/design the (data) model part of your application, while the user interface (UI) corresponds to the view part within a model-view-controller (MVC) architecture. As a UI cannot be designed with a class diagram, I cannot see any meaning for a "UserInterface" class.

However, there is a new modeling language for modeling user interfaces: the Interaction Flow Modeling Language (IFML), which has been adopted as a standard by the OMG in March 2013. If you are serious about UI modeling, then you should use that language.

Time answered 18/2, 2014 at 14:37 Comment(5)
A UserInterface class is often created as the main container class for all senior UI classes instancesPurposely
Of course, you can create/use such a class, but it doesn't make sense in a class diagram for designing (the model of) an app.Time
Why? If you have several screens and windows and command sets, and UI having all of them, I think a class diagram could be useful.Purposely
@Purposely but if the UI elements are not classes, why should they be included in a class diagram? I actually found a project which has them and I'm confused now because I thought you'd only include classes and their relationships.Wartburg
@Wartburg You could use a class diagram for many things except OOP classes. For example, the user manual structure, It is enough that you can think of objects as classes. As for class diagram representation of the UI, you can set new meanings for the class diagram elements and model UI functionality without concretizing the graphics. I do it for about 8 years.Purposely
I
2

Classes of UI can be modeled as ordinary UML classes. You can create stereotype "webpage" if you want of course. If it is needed to define internal structure of UI class use composition. In sequence diagram you can define interaction between instances of UI classes in common way.

Example: enter image description here

Innuendo answered 24/2, 2014 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.