The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of JBoss AS 5 Development this week in the JBoss forum
or Spring Dynamic Modules in Action in the Spring forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
Author

help with complicated uml diagram

shaf maff
Ranch Hand

Joined: Sep 07, 2008
Messages: 180

Hi Guys

I have an application with three layers, the DAO layer, processor layer and front controller layer. Each layer has around 7 classes. Each class explicity declares which DAO or processor it will require in the class attributes section. My question is, will I still need to provide associations between the layers ? The design is already complicated and I fear having to add around another 20+ associations will just make it more confusing.
James Clarks
Bartender

Joined: Apr 16, 2008
Messages: 1222

My question is, will I still need to provide associations between the layers ?


No. This thing sounds so complicated and confusing that only you will be able to understand it. Best to not even waste your time on a Class diagram.

Strange thing is, how did you design all of these complicated layers and classes before creating a Class diagram? Sounds backwards, in my opinion.

What do you plan to do with the Class diagram?

This message was edited 3 times. Last update was at by James Clark


BigDecimalBear/>
shaf maff
Ranch Hand

Joined: Sep 07, 2008
Messages: 180

Yeh you're right, Im doing it backwords. Its for one of my projects.
James Clarks
Bartender

Joined: Apr 16, 2008
Messages: 1222

Next time try something different. Instead of rushing to start writing code and compiling, create Package and Class diagrams first. Then, review these to see if they can be simplified and make changes. Then, create a few Sequence diagrams that outline the most interesting algorithms.

Once you have these diagrams in place, then start writing code and compiling. This will enable you to create cleaner code that is easier to understand.

"Complicated" software is not a good thing. You should strive to create "simple" code, as simple as possible is best!

BigDecimalBear/>
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Messages: 14088

What are you trying to communicate, and to whom? How would you best depict the knowledge you want to transfer?

Remember that most often, a complete diagram is a wasted diagram. The art of modeling is to highlight the important parts by neglecting everything else.

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
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Messages: 14088

James Clark wrote:
Once you have these diagrams in place, then start writing code and compiling. This will enable you to create cleaner code that is easier to understand.


My experience is different. While I agree that being able to visualize a rough structure at the beginning can be helpful, there are simply forces at work that only show once you start coding. Drawing a UML diagram is mere speculation, even if well educated speculation.

In my experience, creating cleaner code that is easier to understand mostly comes from being able to sense code smells while writing the code, and ruthlessly refactoring the code to an as good state as we are capable of.

I've heard good things about the book "Clean Code".

"Complicated" software is not a good thing. You should strive to create "simple" code, as simple as possible is best!


I wholeheartedly agree!

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
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
IntelliJ open source