wood burning stoves 2.0*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Regarding the order of UML diagrams in Design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Regarding the order of UML diagrams in Design" Watch "Regarding the order of UML diagrams in Design" New topic
Author

Regarding the order of UML diagrams in Design

Radha MahaLakshmi
Ranch Hand

Joined: Mar 28, 2003
Posts: 45
Hello Everybody
I started reading UML couple of days back and i read various diagrams used in designing.I wanted to know in what order wh should go.
For example we are designing a payroll system
I should start with preparing usecases.Once usecase is are finalized then i prepare scenario diagrams for each scenario in use case.Once scenaridiagram is ovce i prepare sequence then collaboration.
I know i should do activity and statechart diagrams also before starting class design but not sure where to fit.
Can some body help me.Please tell me whether the order i followed is correct.

Regards
Radha
[ August 28, 2003: Message edited by: Radha MahaLakshmi ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The order of and the combination of UML diagrams to use in a project varies according to the needs of the project. I know some rigid processes force you to produce this and that document/model before moving to the "next phase" but that's not necessarily the best approach.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Radha MahaLakshmi
Ranch Hand

Joined: Mar 28, 2003
Posts: 45
Hi
You mean we can skip some of the diagrams depending on the project is it???

If you are following good design principals and wanted to trace back any time to find why you arrived to a particular decision i feel its alwys better to go through all steps insted of skipping.
I would like to know what is the order in general most of the designers follow though it varies from application to application depending on various factors.
Regards
Radha
[ August 29, 2003: Message edited by: Radha MahaLakshmi ]
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
If you are following good design principals and wanted to trace back any time to find why you arrived to a particular decision i feel its alwys better to go through all steps insted of skipping.

The whole point of UML models is to help cut code.
Once your code is written , you may as well throw them away.
Modelling is a way to aid communication.
When you need to write more code, get into the habit to draw the models piece at a time.
Some models may be worth keeping.
I think Object Diagrams or the more abstract Class Diagrams, Data Model Diagrams( which is not UML), perhaps ?

The rest are possibly easily generated from code and give no added-value to the code. If you don't understand the code you probably shouldn't be working anywhere near the code.
A new one that's coming is Component Diagrams which I feel would be worth keeping.
My 2p.
regards
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
You mean we can skip some of the diagrams depending on the project is it?
Almost. The point of the UML was to include as many types of drawings as were felt necessary to cover every design possibility. Whether that goal was achieved is another question.
An upshot of this is that for any particular design/communication problem, you only need a subset of the UML diagrams. If you don't need to commincate a particular aspect of your design, then there is simply no point in drawing that type of diagram. If your design is stateless, why draw an empty state diagram?
If you are following good design principals and wanted to trace back any time to find why you arrived to a particular decision i feel its alwys better to go through all steps insted of skipping.
I'm pretty sutre that what Lasse was trying to explain is that UML diagram types are just a "bag of tools". There is no set order, or even recommended order. Draw only the diagrams you need for your application, and only when you need them. This may mean that you draw one diagram type for one part of your application, and later find that you also need that diagram type for another part.
I can't help thinking that you have a misunderstanding of what UML is for. The act of drawing a UML diagram is not design itself, it is communication of a design. Some people may use UML diagrams as notes to themselves when designing. Some people may use UML diagrams as explanations to others. Design is an activity that happens in people's heads, UML is simply a standardized way to explain or record such designs. Programming is not the same as typing, designing is not the same as drawing.
And so we come back to your original question. You almost certainly don't need all the diagrams, and as diagrams are for communication of ideas not generation of ideas, you need to find out who the diagrams are for, and what they need to understand by studying them. Once you have that, you should produce only the diagrams which communicate the needed information, and include on them only the things which are relevant.
Has this helped?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Radha MahaLakshmi:
You mean we can skip some of the diagrams depending on the project is it???

Yes. Depending on the project, you could even skip *most* of them, or replace them by something else.


If you are following good design principals and wanted to trace back any time to find why you arrived to a particular decision i feel its alwys better to go through all steps insted of skipping.

When do you need to trace back and how do diagrams help???

I would like to know what is the order in general most of the designers follow though it varies from application to application depending on various factors.

I don't think there is a general order. The main purpose of a model is to enable you to do the next step, until you finally can write the code. So, if you know the requirements and are sure about how to code the system, you don't need any intermediate models. If, on the other hand, you have some doubts, you need to select the best model to examine that doubt. That model might be an UML diagram, or it might be something else (textual use cases, CRC cards, whatever).
Also notice that you don't "finish" one model, getting it "right", before you go to the next. That is because the next model will give you feedback about the ones before, so you might get new doubts (or new ideas) you want to explore. Even when working on the code, new questions about the requirements might arise, for example.
See http://www.agilemodeling.com/essays/iterateToAnotherArtifact.htm


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Nalla Senthilnathan
Ranch Hand

Joined: Jul 13, 2003
Posts: 40
Originally posted by Radha MahaLakshmi:
Hello Everybody
Please tell me whether the order i followed is correct.
[ August 28, 2003: Message edited by: Radha MahaLakshmi ]

First decide on the list of diagrams that help convey your design. Then order it based on the feasibility of generating the diagram. For instance, sequence diagram can be generated only after classes are identified. So a class diagram precedes sequence diagram. Subsystem and component identification happens before class identification. So a component diagram precedes class diagram.
Nalla
Radha MahaLakshmi
Ranch Hand

Joined: Mar 28, 2003
Posts: 45
Hello All
Thanks for your replis.
I understand what you are saying,but i am not able to realize the class diagrams from my use casses.
I am working on an applicaton which is used to place some trades for various funds.The UI is more or less similar for all the funds with slight variation.
Without thinking much i relaized that i need to have 5 clients for 5 typs of funds and a server program to receive the information and update the database.I can start coding by writing one calss for each client and a server to receive the information sent from client.
I dont know whether this is good way of doing or not but i thought if i go through all these steps it could have helped me in designing in a better way.
-Radha
[ August 29, 2003: Message edited by: Radha MahaLakshmi ]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Nalla Senthilnathan:
For instance, sequence diagram can be generated only after classes are identified. So a class diagram precedes sequence diagram.

On the other hand to know which classes to build into your system, you need to know how to distribute responsibilities - and sequence/collaboration diagrams can help you do so. Another way to do this is using CRC cards (which are kind of an interactive mix of class and collaboration diagrams).

Subsystem and component identification happens before class identification. So a component diagram precedes class diagram.

Again, not necessarily. You might very well discover new components/subsystems while designing your classes.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Radha MahaLakshmi:
I understand what you are saying,but i am not able to realize the class diagrams from my use casses.

We should make an important distinction here: Are we speaking about an analysis or a design diagram?
The former is simply depicting (part of) the problem domain. It is used to foster understanding of the problem and often can rather easily derived from requirements.
The latter is depicting how you (plan to) build the solution - the software system. Even after fully understanding the problem domain, it often takes a considerable effort on creativity to get a good system design. There simply is no direct, automatic mapping from the former to the latter.

I dont know whether this is good way of doing or not but i thought if i go through all these steps it could have helped me in designing in a better way.

I agree with Frank here - drawing diagrams just means to depict your thoughts. If you aren't sure what makes a good desing, drawing diagrams won't help you much.
In fact I think spending too much time on diagrams can in fact handicap less experienced developers, as it delays feedback from actually coding the design and increases the effort of applying changes.
So my advice would be to do many experiments with actual code and getting good at refactoring (that is, finding out about problems in your design based on the existing code and applying changes without compromising functionality).
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4446
    
    5

Originally posted by Radha MahaLakshmi:
I dont know whether this is good way of doing or not but i thought if i go through all these steps it could have helped me in designing in a better way.[ August 29, 2003: Message edited by: Radha MahaLakshmi ]

Sorry if I'm beating a dead horse here but I think it is important that you understand the main point (not that I think it's not been explained well enough because it has).
UML is just a tool, a way of expressing/communicating ideas. The UML can help you organize your thoughts and have something to guide you while you create your application. But you have to be careful not to go overboard. If you're building a high-rise office tower, you'll have to create a number of plans. But if you're only making a chair, would you go to the trouble of making blueprints, plumbing and electrical layout plans, and architectural perspectives? A rough sketch will usually do, right?
Same concept with using UML. Don't think you have to use all of the diagrams it specifies. Create only the diagrams that will help you understand the problem and/or what you need to do. Anything else is just a waste of time, effort, and your client's money.
Yes, it can be confusing and it's a lot harder to decide what kind of diagram would be applicable especially if you don't have much experience using UML at all. But don't worry, there are a lot of people here who will be more than willing to help out. And if you ask them enough questions, you may not even need UML


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding the order of UML diagrams in Design
 
Similar Threads
Need Guidance
Would Appreciate Your Advice
SCEA - Part I - Prepration
patterns
class diagram and sequence diagram