Do I need to include dialogues and JFrames in a class diagram? - class

I'm creating a project documentation for a Question management and generating system and need to draw class diagrams from that system.
My question:
I have a lot of dialogues and frames since I'm programming in Java. Should I include the GUIs with the diagram and relate them to other control classes?

Related

Class diagramm for a client-server game

I'm an university student and I'm trying to do a class diagramm for a very simple client-server game.
The game consist of a online rouge-like when 2 player explore a dungeon. I'm having trouble to identify an easy class diagramm. Should I show in the class diagramm the server class and the client class? What other classes should I add?
Here is what I’ve done so far:
It is recommended to keep class diagrams small and focused on a given topic. This is true for simple games, as it is for complex systems. This leads to have several diagrams that are easy to read rather than one big and extremely complex diagram with all possible classes of your system. It would therefore seem better to keep client and server classes separate in different diagrams.
In the special case of a client-server system, the client and the server might moreover have different designs targetting different technologies. This is one reason more to keep them separate, unless you intend to reuse the same design on both sides, for example if you intend to have a common code base with a rich client.
However, it could be very helpful to you, to use a component diagram, at a higher level than individual classes. Component diagrams allow to focus on the interfaces between the parts of your system and will allow to explain the big picture (e.g. that there is a client and a server and how they are interfaced) before diving into the details.

Should GUI classes be included in class diagram in UML

I need to develop a system for a library system from Java & Netbeans. I am wondering do I have to include classes made from Netbeans for user interfaces in the class diagram. In addition to that suppose we have a class "Librarian". I assume that I can create two classes one for UI and one that including details in the class diagram and use it in the UI class. Or I can implement, what class diagram says directly in the UI class for "Librarian". Please tell me which is the correct way that software engineers are supposed do.
Whether or not to show something in a class diagram depends on the intention of the editor and what he wants to show to his audience. Often it's a good idea to create overview diagrams where you omit details. The overview is then accompanied by a couple of detail diagrams which are logically oriented at sub-domains which in turn help to understand the systems as a whole.
Also it's not uncommon to just leave out "obvious" things. If you work with known scaffolds in certain domains you must not describe that again and agin but just can assume that it's known. In your case that would be the GUI part which will be known implicitly. You might consider to create a sketch of the scaffold somewhere in a more general class diagram. This could be helpful for people coming from other worlds (and not knowing NetBeans like me).
Beware of drawing wall-papers that contain each and every detail in a single class diagram. Looks impressive but is absolutely useless (an anti-pattern if you like to call it that way).

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

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!
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.
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.
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:

UML Class Models Needed for research

I am doing research on UML class models. While pursuing that I need sample UML class models (preferably realistic and industry size).While searching on Internet, I do not came across any standard repository of class models. Kindly help me in getting such UML class models for my research work ?
You can see many diagrams simply searching for their names (class diagram, for example), in the Google search for pictures.
Also you can find many of them searching for different OOP patterns.
Many big and correct diagrams you can find in the UML standards - they use UML diagrams for defining UML diagram elements.

What is Eclipse Modeling Framework?

I am sorry, this might look too simple, but I am vague about what Eclipse Modeling Framework is?
Based on their website, it generates java code, based on XML specification.
I wonder if it is something like Visual Paradigm?
And does it generate code for other languages (such as PHP) or just for Java?
Thanks.
EMF is a framework that can take a model (as described in a .ecore file) and generate the supporting Java files that can be used with EMF to build, load, manipulate and save instances of that model.
That means you use EMF when you are writing a Java application and want to manipulate a model (an abstract syntax tree for a language, a model that can be displayed by your View, a domain that needs to be manipulated, etc).
There are a lot of modeling projects, and they add support for more and more functionality but most of it is based on EMF.
Basically, EMF is a framework for developing model driven development (MDD) tools.
The tools you will be interested in are in the Model To Text (M2T) section. Using tools like JET you can generate logic-containing business objects, not just simple DTOs, in any language you want. You can generate code from domain-specific languages (DSL) that you define yourself (usually in XML) or from standard modeling languages (UML or Encore).
When you have picked a modeling language, there are ways to build your models using graphical tools (GMF). In addition, EMF has the validation/translation tools you would expect.
Having tried out several of the code generation tools, I can say that it was a worthwhile experiment. However, it requires a significant investment to learn and puts you at risk of depending on one particular tool. If you find yourself in want of a code generation tool, also consider that you may have a language smell or haven't refactored out enough duplication.