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.
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!
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
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