UML High Level Class Diagram - uml

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.

Related

problem with the diagrams of the rational unfied process

I want to verify that i correctly understand the rational unified process.
My understanding is:
For the requirements specification activity, i have to design the use case diagram (a general one), the class diagram (classes, attributes, relations), and a general sequence diagram.
For the analysis activity, i have to design a detailed use case, the sequence diagram (using control, view and model classes), the analysis class diagram, the collaboration diagram
For the conception diagram, i have to design the class diagram and the deploiement diagram
is that correct please?
for my questions:
When can i use the activity and the state-transition diagrams?
Is it correct to first design a class diagram in the requirement acquisition phase?
In the implementation phase, which diagrams do i have to use? Or do you only have to generate code from some diagrams?
thank you a lot !!
Your assumptions are right.
ADs are used to illustrate scenarios from a use case. State transitions are usually created for classes. The can be used in code generation.
Not really. To sketch a class diagram of your solution you need a rough idea how that could look like. Just taking it from requirements works only for simple systems. You need to go through the use cases first to settle a usable construct.
To implement a system some class diagrams are essential. SDs help the coder to see how the classes collaborate. You can not generate code from that. Only code stubs from classes.

Class diagram vs State diagram (UML)

Can someone give me an example of when is better to use State Diagram and when Class Diagram. Tnx in advance!
For what type of software system would you use state machine diagrams to model functional requirements?
For what type of software system is data modeling via UML class diagrams suitable?
A class diagram shows classes in their relation and their properties and methods.
A state diagram visualizes a class's states and how they can change over time.
In both cases you are talking about diagrams which are only a window into the model. The class relations define how the single classes relate to each other. A state machine can be defined for each class to show its states. In embedded systems you use state machines almost all the time but there are also state machines for business applications (you can do this if that).
This question reveals a very common misunderstanding. There are only thirteen types of diagram in UML. They're not used to describe different types of system, but to describe different aspects of the system you are documenting. Which you pick in any given situation is more a question of style, what you want to emphasize.
It is better to use state diagrams if you want to focus on how the system can go into different states in response to various events. Activity diagrams are better if you want to focus on activities being carried out in some order, sequence diagrams are better if you want to show messages being sent between entities.
The above are all types of diagram which show behaviour. Class diagrams are a different type of beast altogether, and show how structures of things fit together (as do package diagrams and component diagrams).
It might be worth pointing out that while UML does not include a "requirement" element type, the related modelling language SysML does. If you want to express a number of functional requirements on the form "the system shall" in a model, SysML is a better fit.
A state diagram shows the behavior of the class. A class model shows the relationship between two or more classes. It includes its properties/attributes...
A state is an allowable sequence of changes of objects of a class model.

Class diagram from use case, should I include the system?

I am trying to build a class diagram from use case. But I am not sure if I should include the system in class diagram. I have system as actor in use case diagram. If I include it in the case diagram can I use it without attributes....
"I have system as actor in use case diagram" - Actor can be human or non-human system external to your subject that is your whole system. For example, card payment system or buyer are actors for net stores. You can show your system in the use case diagram, too, but it will be a rectangle, containing ALL use cases - not really so much useful thing. But showing of SUBsystems can be useful.
Later you can draw a deployment diagram - if different subsystem lie on different computers. And maybe, some dynamic diagrams of how they talk to each other and actors.
If we are talking on static diagrams, your next step will be component diagram - you'll divide your system in smaller parts and show who talks to who and here already the classes of messages being sent can appear.
Later - you'll plan what packages will contain your classes and what will be visible from which. Package diagram.
Later - yes, at last we are here - you create the class diagram(s). Maybe, several - for different components. So, you are a bit too in a hurry.
Sometimes, especially, if you work with some special objects of some class(es), you need Object Diagram.
And don't forget - there are also dynamic diagrams, I have mentioned static ones only.
Can you please elaborate your question with specific example in order to get better knowledge about the scenario?
As far my knowledge, one can use the system such as any controller class which is again an actor here as class in the class diagram.
"I am trying to build a class diagram from use case"
Use-cases are a very abstract and user-centric view of the system while class diagrams are fine-grained and technically focused.
So you should not try to infer your classes directly from a UC diagram. Instead, use the repertoire UML gives you (component-, activity-, sequence diagrams etc.)
In my experience, I usually create Object interaction Diagram from Use Cases. Mostly, the nouns on the Use Cases are Classes ... In Object Interaction Diagrams, I can have clear ideas about the methods and lifespan of the Classes ...
"Object Interaction Diagrams" or "Interaction Diagrams" are usually to elaborate a single use Case ..
A simple google search gave me this link and it gives you some idea ...
http://www.cs.unc.edu/~stotts/145/CRC/Interactions.html

Differences between a conceptual UML class diagram and an ERD?

If I create a conceptual class diagram such that each class captures 'name' and 'attributes' but not 'operations', have I not basically created what would be otherwise considered an ERD? I'm trying to gain an understanding of what the differences are between creating a conceptual class diagram as I have described versus calling it a ERD? If these are still two different animals, can somebody please explain what the differences are?
The class diagram contains just the classes in your object model with eventual links/relationships connecting diagram elements. However those links don't necessarily correspond to physical relationships like in an ERD diagram, but instead they represent logical connections.
The class diagram is just the object model of your application and does not contain any persistence-specific information. When you think about the class diagram forget about the database or any other storage you may use.
The ERD diagram on the other side, is a persistence-specific diagram which display the entities (tables) existing in a (most often) relational database. It also displays the physical relations (and cardinalities) between those tables and all other database-specific information. The ERD diagram can sometimes look similar to the class diagram, but that doesn't mean is the same as a class diagram.
There´s little difference in the expressiveness of both (if we just focus on the attributes, classes and associations part) if you use Extended Entity Relationship diagrams (the most common case nowadays)
True, they look very different at the graphical level since they use different symbols for the elements but the "semantics" are quite similar. They both allow inheritance (again, I´m talking about EER), n-ary associations, association classes, ...
The ER diagrams I've seen (most frequently ERWin IE notation) have focused on the design for a database. They are concerned with primary keys, foreign keys, have unnamed relationships, and usually have no generalization / specialization.
A good UML conceptual class diagram, on the other hand, is not concerned with keys, reflects the problem domain, and has association-end properties that at least hint at the semantics of why things are related. This helps communicate the domain down to more junior developers so they don't have to guess.
It depends on the situation where you may not like to do the ER-D. But imagine if you have a seperate data layer where the data logic is handled. In this case many details of data shall not be shared with the application layer. And you class diagram shall not go beyond the application layer. I must stress that both the diagrams are not equal. And there are situations where you need to do both, mainly in multi-tier architecture, and there are situations where you may be able to just use class diagram; e.g. single-tier application.
I strongly advocate the view that class diagram doesn't abrogate the E-R diagram.
Design class diagrams are made from conceptual model and collaboration diagrams.
Design class diagrams include:
Classes, associations and attributes
Methods
Types of attributes
Navigability
Dependencies
IMO In Simple terms
Class diagram depicts the details of how will the system work.
ER diagram depicts how the system persists 'state' as a blue print.
Goal:
Detail out state and behavior of the components(classes) of the system.
Design 'efficient', flexile system(less coupling and more cohesion) using Solid principles.
Goal:
Design a blue print of how to 'efficiently' persist the state of the system.
Consider what kind of queries will be made (read vs write), are there any joins required
consequently figure out the columns for indexing
Use Normalization, ACID properties.
PS: notice the both the diagram tries to efficiently do thing in their on respect.

which should be drawn first , class or sequence diagram?

I've had this discussion with my professor at college about UML diagrams .
He believes that sequence diagrams should be drawn before getting to class diagrams, but I think the opposite . I think after finishing the usecase diagram , the next diagram should be class diagram and after that we should get to sequence diagram.
Rational rose requires us to use the classes in sequence diagram, which are already in class diagram.
Can anyone help me with this?
I think you're both wrong. They should be drawn at the same time. As you're drawing your sequence diagram, you will undoubtedly come up with properties that you will need to keep track of the state, or that you hadn't thought of if you do the class diagram in a vacuum.
Of course, this is highly subjective and personal, but years of real-world experience (as opposed to academic theory) have taught me to work on both at the same time. MAYBE starting with the class diagram, but the class diagram invariably changes when you start going through process flows.
Well it depends a lot on how you plan to do things. I think it's a subjective matter. If you rather explain the actions performed for your usecases and after this has been done write the classes based on what you need to perform the sequences your professor is right.
But if you prefer to determine what the structure of your classes are and then adapt the action sequence to this then you would do the class diagram first and later the sequence.
In my experience I do them concurrently. I put the fundamental attributes to the class diagram but not the actions, and while I do the sequence diagram I add the methods and attributes that I need to the class diagram.
There is no one standard answer. There are several opinions, approaches and methods. In Unified Process I believe you first identify use case and then make realizations for them, e.g. sequence diagrams. As in use cases, there are actors and the systems and/or its parts interacting ina sequence. Actually this interactions should help you decompose your design and get to classes. Once you have classes on the analysis level, you can go further to design classess and design interactions. However these are quite a lot to draw in a diagram, most of the times code is the best documentation on this level, even generated diagrams are too large and more difficult to understand then code itself.
To prepare sequence diagram you need classes not the class diagram
You can prepare empty classes on the fly while in process of preparing sequence diagram....
Identification class objects in be part of preparing sequence or you can try to identify your objects before hand....
sequence is logical process while class diagram is end output
I don't think there is an order for creating diagrams since both are two different views of a system: class diagram structural (static) and sequence is behavioral (dynamic). I would start with sequence diagrams since you will discover more classes to create as you go through sequences. Do whatever makes sense for you at the time. If your doing more object oriented programming, I would consider doing classes before sequences.
Structural and behavioural models for all but the very simplest systems are naturally created simultaneously and iteratively, refining both over time.
You may have some method of "object discovery" such as CRC cards, which will yield a set of initial classes, with collaborations (the classes they interact with) and responsibilities, which informs both the methods they will need, and internal behaviour/state/activity.
You may then want to explore the use cases and scenarios using sequence or communication diagrams, this will expose the details of the required object communication and therefore inform the generation of public methods and relationships to refine the class diagram while at the same exploring the system behaviour which may yield further objects and classes to be created.
You may also want to explore the internal behaviour of classes, especially if they have stateful and/or active behaviour; activity ans state-machine diagrams are useful for this.
Either way I doubt that the use of Rational Rose is really the determinant of diagram creation order. Rational may require the classes on a sequence diagram to exist, but I imagine that they need not actually appear on a class diagram; they can probably equally be created on the sequence diagram and then later placed on a class diagram, or even created in the project explorer or whatever the equivalent is in that tool. Even if the only method of creating a class is to place it on a class diagram, that does not require you to refine and complete the class or its relationships before exploring interactions on a sequence diagram.
You need to buy some clothes, how you will proceed. You start choosing clothes first or you will decide first where to go? At the same time, will you go to shoe store if you want to buy shirt.
So both are iterative, but definitely first step is sequence on very high (component) level then drill down to class level sequence
You should first decide your application flow,means you should first draw a sequence diagram. It will show the flow of your application after this you should go for class diagram.

Resources