• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to create class diagrams

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what your doubt is. Perhaps it would help to describe what options you see?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic