Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to get into the proper ways of oop, design patterns and everything. I've picked up alot the past few weeks but I still keep getting unstuck on seemingly really simple issues.

 

Current confusion: -

 

I'm UMLing a web application, situation summarised is: -

 

Members (i.e. users) can log in, view events (I.e. an event held at a specific location), attend events, leave messages about events etc.

 

In my class diagram i have a Member class and an Event class.

Where would a method such as viewEvent() go on the Member class because a member can view an event or on the Event class because it is the event that can display its details?????

 

Also how would i represent the relationship as the potential candidates for relationship as i see it are: -

 

Event - is viewed by - Member

Member - views - Event

Event - is attended by - Member

Member - attends - Event

etc etc...

 

Examples all make perfect sense "Student attends course, College has courses" etc etc, so i keep feeling like an idiot trying to get my head around my own application designs! :confused:

 

Any pointers in the right direction mucho appreciated.

Posted

I would think you'd have something like an EventManager object that would have the ViewEvent method. So your relationship would look like:

                      - Event
                     |
Member - EventManager -  Event
                     |
                      - Event

The EventManager handles all the interaction between a member and an event.

Here's what I'm up to.
Posted

Use UML for your needs. A beginners BIGGEST mistake is thinking that they have to use every document UML provides and write it very detailed.

 

You really should be using a Use Case diagram.

 

Your member is an actor who can Log In, View Events, Attend events, etc.

 

Unless you are going to have a class that implements IPrincipal and pass that around in your applicatation, I wouldn't have a class diagram that represents it.

 

If you are going to go that length though, then that class should be the thing that logs in, views events, attends events, etc. and you would just name the sub routines or functions as operations in your class diagram. But I have a feeling that you have the web application allowing the user (the Actor) view the Events page/screen, and open the attends page/screen, and these are two seperate designs all together.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...