permaculture playing cards*
The moose likes OO, Patterns, UML and Refactoring and the fly likes How to create class diagrams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "How to create class diagrams" Watch "How to create class diagrams" New topic
Author

How to create class diagrams

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I am in a situation where I have a web application that I have to provide class diagrams for. My only concern is the java code right now...

Our package is made up with the following subpackages

biz package - Located here would just be objects with getters and setters. Lets say a Person class. There would be getters and setter for weight, height, shoe size, age, etc..

beans package - Located here would be code that is used to manipulate objects in our biz subpackage. Let's say a PersonBean. It would have methods like getPersonFromDatabase, this would take in some kind of identifier to retrieve this person from the database and populate the Person object. There might be other mehtods like deletePerson, and addPerson. Those 2 methods would take in a Person object and delete or add a person to the database.

servlets package - This would have all of our servlets that are used for things like when people submit forms.

utils package - This would have all kinds of utilities in it like checking for nulls when using a variable or even a Tester for each bean created. Example: PersonBeanTester. This would have code that would test each of the methods in the PersonBean...


I know it might not sound like the most traditional way to do things, but that is what we are working with and I was trying to find out how to create class diagrams based on that.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I'm not sure what your doubt is. Perhaps it would help to describe what options you see?


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
Balachandran Paranjothimani
Ranch Hand

Joined: Jun 18, 2005
Posts: 43
First of all the packages that has been created are not cohesive. This will lead to a system that will become impossible to maintain.

If you document the interaction between packages you will create package diagrams, NOT class diagrams.

Given the way the packages are structured, what is the use of creating package diagrams? I don't see any benefit of creating an artifact that is based on a bad structure for packages. It will be an useless artifact.

If you want to learn how to create class diagrams, read this book on Object Oriented Analysis and Design with UML.


Moderator : <a href="http://groups.yahoo.com/group/OOAD_UML/" target="_blank" rel="nofollow">http://groups.yahoo.com/group/OOAD_UML/</a><br />Home : <a href="http://www.zepho.com" target="_blank" rel="nofollow">http://www.zepho.com</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to create class diagrams