In my android app , i have a lot background classes. My question is should i represent these classes in classes diagram
It is a common mistake to think that there should be one class diagram with all the important classes of the system.
But this is not how it works. Each diagram is meant to convey the relevant information about a given topic. So you may very well have:
a class diagram with none of your background classes because the do not add any useful information to your domain model.
a class diagram with a couple of background classes, for example if you model say a GUI component and some background classes play an important role therein
a class diagram with only a set of background classes, because it could be useful to document those (you probably have such a diagram if you use one of these popular frameworks that comes with a class diagram in its documentation.
Related
I had been doing some UML class diagram examples from the recent exams for my software design course, and I found one where it says:"Design a class model for a specific problem, by using MVC and STATE pattern, but no need to include getters and setters." Is this the same thing as the regular class diagram? I've been googling and I found nothing UML based by searching for class MODEL.
The model is abstract. A diagram is a view on the model. UML offers a number of different diagrams. There are mainly two categories: static and behavioral. Class diagrams fall under the static category and they show how the classes in the model are related to each other. You can create multiple class diagrams like one with all classes (assuming that you have a rather limited number of classes) and/or one per class with that in focus. Or you have sub-domains with related classes placed in one diagram. The behavioral diagrams shed light on how class instances communicate with each other at run time.
As a side note you can think of it in terms of Platon's Cave Allegory. The diagrams are the shadows of the real world projected by a fire to the wall you can see from you chained position.
"Design a class model" means: "Create one or more class diagrams that together form a consistent model".
A model in computer science is a graphical representation of (a piece of) software or of (a part of) the business domain in order to help people know or understand the subject the model represents (see wikipedia). This graphical representation may consist of one or more diagrams.
I know that I can build a Class diagram from a database E-R Diagram (tables become classes, tables properties are the classes properties...)
But I'm looking for informations (or step by step like) to create a class diagram from a use case description (or even a sequence diagram).
(All I found now is that the sequence diagram objects becomes classes and the stimuli messages methodes)
Any idea ?
I used to TA in software engineering, and both create a class diagram from a textual definition as well as create a class diagram from a sequence diagram were regular exam questions.
Creating class diagrams from a specification should be covered in your lectures since its one of the most important things to learn. This site explains the workflow quite well in my opinion.
It is important to note, that in software engineering there never is just one solution. You can tackle problems in multiple ways each with their own benefits and problems. The most important step to learning is doing it yourself, just looking at solutions won't help you.
For creating class diagrams from a sequence diagram:
Objects are instance of classes, in most sequence diagrams there is only one instance of any given class. Therefore "objects become classes" is not technically correct but the right intention.
Messages represent method calls on the receiving object, ergo you need to add these methods to the class of the receiving object.
Any communicating classes need to be associated, else they could not call their methods.
We put focus on only modelling the information you can derive from the sequence diagram, e.g. in most cases you do not know multiplicities of associations.
i'm php developer using MVC architecture that i'm new to UML
i know use-case , class , object , activity, sequence diagrams but i don't know for modeling a application where i should start.
i know use-case and class diagrams are structural diagrams and activity and sequence are behavior diagrams
but my questions are:
1. for modeling a app when i should use use-case diagram and when i should use class diagram?
2. does class diagram has abstract concept? because when i'm developing web app i have some controller and model or view also several classes that i use for different purpose (like insert data to database - validate form inputs and so on) but they don't look like to examples of class diagram that i'v seen until now so my question is class diagram is used for show concept of our system and it doesn't need to generate real class code form it ?
for example modeling a ticket reservation that may have some classes like this:
but we don't write class codes like this and it can be different in programming but for view the concept we are using class diagrams . is it true ?
Use-case diagram is usually used for representing the business of the project, indicate who(actor) are going to utilize the system and what services(cases) does program provide?
The class-diagram is used for specifying the whole system structure, but there no code and exact behavior will be provided by the class, generally developers don't specify the exact behavior with each module in-detail.
for example, consider a simple login module. in use-case diagram, we just mention that user logins into the system.
In class diagram we specify the possible base classes are needed, in other word we apply the architecture (we are planning) basis.
In sequence diagram we focus more on what is going on each method(while this is not necessary).
In fact UMl is used for representing the system as abstract, not the exact(in-detail) functionality.
for example I pass the above class-diagram to a developer, and tell him about the detail login process as a separated document.
I have developed an online web application which uses JSP's and Java classes.
I understand that Java classes would appear on a class diagram but would JSP files ?
My answer is no.
Class diagrams can be utilized for different purposes, at different levels. Two very common usages are design and analysis.
1- Analysis class diagrams show the entities and their relationships and model your problem domain (no solution or technology involved)
2- Design class diagrams model your solution and may contain fabric classes. They are very close to your code. (your Java classes in this case)
Design class diagrams could have different levels of abstraction according to your need. It is very uncommon to include UI details in your class diagrams unless there is a specific reason for it.
Basically you have to make a decision on your scope, for example it is not very useful to include java library classes in your class diagrams unless there is reason for it.
can somebody please explains what is a high level class diagram. As far as I know class diagram shows the association between the classes but what about high level class diagram??
Ok, I knew what this means, a Class Diagram contains many details. A high-level class diagram is a simple class diagram reflecting only initial domain knowledge
What's the context? Class diagrams in themselves are pretty "high-level", in that they only show classes and methods rather than algorithms and other implementation details. It might just be an adjective. Or, you might be looking for something more like a block-level diagram which shows components of a system and how they interact.
I often use the term "high-level", or more usually, "top-level" diagram for the very highest level class diagram I make for a system. Usually this will show as many of the most important packages as will reasonably fit, along with some classes that give the best idea of what functionality the classes in that package provide. From there I can do class diagrams of each package, and so on.
Depending on the type of system and what your supervisor want to see, you may be better off creating a component diagram.