DannyT Posted August 4, 2005 Posted August 4, 2005 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. Quote
Machaira Posted August 5, 2005 Posted August 5, 2005 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. Quote Here's what I'm up to.
bri189a Posted August 5, 2005 Posted August 5, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.