0

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?

Attachments MVC._.JPG 63.68 KB
6
Contributors
18
Replies
19
Views
10 Years
Discussion Span
Last Post by jwenting
0

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.

0

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.

Attachments MVC_v2.jpg 237.78 KB
0

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

0

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.

0

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.

0

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. :)

0

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)

Attachments MVC_v3.JPG 80.57 KB
0

Heres an even more updated version with the accountInfo. is this what you meant? thanks that was a good idea.

Attachments MVC_v4.JPG 83.85 KB
0

Ure Joking... now how is my man thekashyup gonna find it?

0

Looks much better.
Here is a sample of how to use callbacks to eliminate the dependency. During startup/initialization OneControlerClass should create an object of CallbackImpl (which is a contained/nested class in OneControlerClass) and call OneViewClass.registerCallback(), which stores it.
When an event occures OneViewClass calls the callback() method of the stored object.

-1

please give me your detailed design coz i have a similar project

Votes + Comments
Stop diluting the value of my degree.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.