Sorry - thismay be semi-off topic (but then again it may be semi-on
topic - possibly even flat-out on topic!)

I'm working on modeling an existing procedural system (first built in CF
4) to CFMX and want to implement "correctly" (as possible) in an OO/CFC
framework.

I'm doing the static model now and have run into a conceptual problem.
Hoping for some opinions.

The system is an event planner for a large, single-day festival.
Stripping it down to the problem domain we have a database model with
three tables:

1) "Events": All the events taking place.

2) "Venue": All the locations that events can take place at.

3) "TimeSlots": All of the tied begin/end times for events.  For example
"10:00-14:00", "10:00-11:00", "13:00-15:00", etc

In the DB this works well.  "Events" and "TimeSlots" are joined with
"EventsToTimeSlots" (many to many).  You can then query easily based on
start-time, end-time, or duration.  "EventsToTimeSlots" also links to
"Venues".  This allows an event to occur at any time and each time to be
located at a distinct venue.

So we may have a dance troupe appearing at 8pm-10pm at the Boston Ballet
bulding, then from 11pm-midnight at Boston Common.

When converting this to an object model I naturally began by considering
"Event", "Venue" and "TimeSlot" as objects.  (Right?)  My issue is how
to deal with the three-part join.

I have, for example, an array in each TimeSlot object containing a
references to all the events taking place.  I can then loop through all
the timeslots and collect all the events taking place at any time or of
a certain duration.  Sorting this kind of return may be a problem, but
not (I think) big one.

I can also have an array of references in each Venue object to events
taking place there.  Lastly (I'm guessing) can have a two-dimensional
array of TimeSlot and Venue references in each Event linking each
timeslot to a venue.

Is this the best way to do this?

Should I instead some "sub object" that directly represents my join
table that contains a reference to an Event, TimeSlot and Venue?  Maybe
called "Schedule" or something?

Or should each TimeSlot object contain a single reference to an Event
and Venue and just have a lot of duplicate StartTime/EndTimes?  (I don't
think I would as it would be more difficult to present the details of a
single event.)

Does this whole "Timeslot" idea just not fit in OO as well as it does in
the relational system?

In the end the model I want should allow each event object to quickly
get the venue and time for each performance (perhaps that goes without
saying) but I also want to be able to easily list "All events at Venue",
"All events at TimeSlot" and "All events at StartTime/EndTime".

Thanks in adavance,

Jim Davis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137575
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to