Even harder than coding... designing code. UML diagrams

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Mar 2007
Posts: 27
Reputation: eeeman is an unknown quantity at this point 
Solved Threads: 0
eeeman eeeman is offline Offline
Light Poster

Even harder than coding... designing code. UML diagrams

 
0
  #1
Mar 19th, 2007
Hi guys I need to design my project in a UML diagram with a MVC design pattern.

The project I am trying to design is a system for KIds that they can store and use thier files within thier MyWorkSpace.

They have a musicbox to store music, picture album for pictures etc.
They also can search through thier files and add keywords to thier files.

They have a scrap book where they can creat folders (similar to musicbox and picture album.) And name those folders and put any file type into thier folders.

This is the UML diagram I got so far but it looks so messy, anyone got a better solution?
Attached Thumbnails
MVC..JPG  
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: Even harder than coding... designing code. UML diagrams

 
0
  #2
Mar 20th, 2007
Even harder than coding... designing code. UML diagrams

>> Even more "interesting" you must say..

1. You've posted in the wrong forum.
2. Problem is you've not followed the basic principles of MVC Pattern
E.g. only following dependencies are allowed:
- C->V
- C->M
- V->M
You have V->C and M->C as well. That's why it looks messy.

Here are a few things you can do:
1. Use Struts.
2. Eliminate dependencies from V->C by using callbacks.
2. Move the class ScrapBook from C to M (it doesn't belong to C).
3. Make sure that all classes in M don't DO anything, i.e. they have no functionality and are meant for ONLY holding data. So no functions (except for get/set). E.g. FileManager belongs to C not M.

In general look at all the dependencies that should not be there allowed and see how to break them. If you need more specific help get back with the improved version.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 27
Reputation: eeeman is an unknown quantity at this point 
Solved Threads: 0
eeeman eeeman is offline Offline
Light Poster

Re: Even harder than coding... designing code. UML diagrams

 
0
  #3
Mar 20th, 2007
Lol yeah very "interesting" :rolleyes:

Thanks alot I'll take this information into account.

Heres a more improved version but I'll continue to edit based on what you said, I dont quite get callbacks and struts but I will continue to research.

1. Why do I put Scrapbook in M, Scrapbook creates folders for kids called "Projects"?

These new diagrams will be easier to understand the first diagram is showing the connection I got so far and the second are trying to put it within the UMV.

Thanks alot again for replying man, I was losing hope.
Last edited by eeeman; Mar 20th, 2007 at 2:03 am.
Attached Thumbnails
MVC v2.jpg  
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Even harder than coding... designing code. UML diagrams

 
0
  #4
Mar 20th, 2007
Software design is a complex field of its own, requiring training and experience to master just as does programming.

And no, just using Struts won't help. In fact Struts is now recognised as a very poor choice due to its tight coupling between framework and application code.

Get some good books like Head First Design Patterns http://www.oreilly.com/catalog/hfdesignpat/ AND Head First Object-Oriented Analysis and Design http://www.oreilly.com/catalog/hfobjects/ and start studying.
Without the second you'll make a mess of what you find in the first, and become a pattern nut (I've seen the results of that, people using a specific pattern everywhere whether it's appropriate or not just because they fell in love with it).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 27
Reputation: eeeman is an unknown quantity at this point 
Solved Threads: 0
eeeman eeeman is offline Offline
Light Poster

Re: Even harder than coding... designing code. UML diagrams

 
0
  #5
Mar 20th, 2007
It is said that this design pattern (MVC) is appropriate for this project so I will stick to it.

I am just trying to see if I have a design that is more or less correct and that is in the correct places and has the correct connections.

I do not need to master it.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: Even harder than coding... designing code. UML diagrams

 
0
  #6
Mar 20th, 2007
Whatever you say eeeman you must agree that "Software design is a complex field of its own, requiring training and experience to master just as does programming."
Anyway, few issues that new design doesn't address:
2. Eliminate dependencies from V->C by using callbacks.
>> This isn't done. Do you know how to do it?
2. Move the class ScrapBook from C to M (it doesn't belong to C).
>> I said this coz I thot ScrapBook is some class whose object just hold the data of ScrapBook and NOT do anything (like create a project). If it has some business logic it belongs to C as you had done. See the point below also.
3. Make sure that all classes in M don't DO anything, i.e. they have no functionality and are meant for ONLY holding data. So no functions (except for get/set). E.g. FileManager belongs to C not M.
>> This is the biggest issue with new design. It somehow seems to me that you've tried to eliminate the wrong dependencies between M-V-C, but just by moving classes from one box to another. Correct way would be the design appropriately.
May be an example would help:
- CreateNewAccount has business logic (createAccount()) so it should go to C not M.
- Same goes for Login class.
- Now the information in CreateNewAccount, namely Username and Password, seems to be used by another class viz Login.
-> So you should create a class say AccountInfo that contains only Username/Password as member variables and get/set methods for them. This class should belong to M as it's only "data" and no logic.
Your classes from C (Login and CreateNewAccount) should use this data to execute their Business Logic (viz createNewAccount() and Login() ).
If you can upload your mdl file I could make easier and faster modifications.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: Even harder than coding... designing code. UML diagrams

 
0
  #7
Mar 20th, 2007
Just to add to last point: So in short none of the classes in M should have any other functions than get/set ideally.
And the new design does look better than old.
Last edited by thekashyap; Mar 20th, 2007 at 8:08 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 27
Reputation: eeeman is an unknown quantity at this point 
Solved Threads: 0
eeeman eeeman is offline Offline
Light Poster

Re: Even harder than coding... designing code. UML diagrams

 
0
  #8
Mar 20th, 2007
For some reaseon I cant upload the UML. But heres my design now.

The problem is I cant see how V->C cant be dependant, how can you get to the controller without goign through the veiw (eg gui)
Attached Thumbnails
MVC v3.JPG  
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 27
Reputation: eeeman is an unknown quantity at this point 
Solved Threads: 0
eeeman eeeman is offline Offline
Light Poster

Re: Even harder than coding... designing code. UML diagrams

 
0
  #9
Mar 20th, 2007
Heres an even more updated version with the accountInfo. is this what you meant? thanks that was a good idea.
Last edited by eeeman; Mar 20th, 2007 at 10:26 am.
Attached Thumbnails
MVC v4.JPG  
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 27
Reputation: eeeman is an unknown quantity at this point 
Solved Threads: 0
eeeman eeeman is offline Offline
Light Poster

Re: Even harder than coding... designing code. UML diagrams

 
0
  #10
Mar 20th, 2007
I guess I can send you the file in a zip :cheesy:
I think
Attached Files
File Type: zip Class Diagrams.zip (24.5 KB, 16 views)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC