This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Class Diagram UML diagram

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need someone to guide me develop UML diagram for the situation presented below.
1) class diag, seq. dia...
I have a class(A) which
1) reading MQ message
2) reads from the database for getting some results for verification
3) Read a property file
4) sends a part of the message to another class and gets a resultant message from that class
5) finally passes the resultant message to another class (B) for further process.
(B) class now chooses to call
1) out of 6 classes any one class based on some identification from
the message received from (A)
another question
1) when i am instatiating another class in one class mentioned above
how will be presented in the class diagram.
thnx in advance
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, don't panic! Sounds like you have a good idea of major classes and messages (method calls) between them so you're in a good place.
Try an Object Interaction Diagram first - bubbles for objects, arrows for messages. I start with bubbles in a big circle for fewer line routing problems. Draw an arrow for each message, label it with a sequence number and description. If object A calls B twice, you can make two arrows or one arrow with two labels stacked up.
Play with this a while. Run various success/failure scenarios. Get a feel for the flow of information and control. One thing I learned from my dad who taught college math for 32 years: use lots of paper! Make big diagrams. It's ok to throw it out and start over.
When I think I know what's going on pretty well, I usually switch to a sequence diagram. Technically these two diagrams contain exactly the same information and some tools can transform one into the other. I like sequence diagrams to show more detail and start to investigate the logic. I often switch to a graphical tool for this; sequence diagrams are a bit tougher in pencil & paper.
You asked about showing object creation. Some people do, some don't. You can often ignore it. Then again, if it makes you more comfortable to be explicit, go for it.
Neither diagram shows complex logic well. Like the choice between 6 objects. I think there is UML notation for "exclusive or" drawn across 6 arrows, but a simple comment would tell you the same thing. And if all 6 objects use the same abstract ancestor or interface, you can get away with just drawing the abstraction for now.
All that stuff is dynamic - runtime messages between classes. The class diagram is static dependencies and relationships. A lot of people like to make CRC cards - real 3x5 cards that list class, responsibility and collaborators. That's a neat way to physically handle your classes and get a different feel for them.
Now you're looking to see if the classes make sense. Do they do one thing well? Are there circular dependencies? Do they have the information they need to to their jobs? Now you can show the relationship of those 6 objects. Do they extend a common superclass? Implement a particular interface?
My biggest problem is staying at the appropriate level of abstraction. I always want to dig into too many details. Maybe you show a simple arrow from one object to an EJB but you know that's really: do JNDI lookup, get home object, get remote object, call the remote, marshall the data, and so on. On day one the simple arrow is plenty. All those details can go into their own diagram later.
I'd repeat that throw it out and start over bit again. Maybe try this twice and see if you get the same answers.
 
Genie mani
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanx Stan.. but what i need i a UML notation diagram for the above , i have already made a diag for the same but its a mixture of class diag as well from Chen diag( used to databse ) and not a proper UML one....
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you care that it's proper UML? Whom are you doing it for?
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Genie mani:
1) when i am instatiating another class in one class mentioned above how will be presented in the class diagram.


Not at all. A class diagram shows the static structure of your system, whereas instantiating a class is dynamic behaviour.
If you really need to depict those two together, you could mix the class diagram with another type, of course.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are some samples and tips on the Diagrams of UML 2. See if that's enough of a jump start to begin drawing.
It's important to know who your audience is. If you have to do some school work stick to rigorous UML, the more complex the better . If it's for a few colleagues, stick to the simplest options of the UML - nobody knows ALL the obscure decorations on the boxes and lines. If it's just for you, some boxes and arrows on a napkin may do.
I find it amusing that we are essentially a RUP shop, use a lot of Rational tools including Rose to draw UML diagrams, but we very rarely produce UML diagrams. We do a lot of lovely presentations for management in no particular notation at all, mixing 3D boxes with gradient colors for objects, computers, components, subsystems with arrows for data flow, control flow, dependency flying right and left.
Oh, I said "object interaction" which is now "communication". They keep changing the darned names. That one already changed once before.
[ June 06, 2003: Message edited by: Stan James ]
[ June 06, 2003: Message edited by: Stan James ]
 
Can't .... do .... plaid .... So I did this tiny ad instead:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!