This one's probably simple but my brain doesn't want to handle it.

I've got a "Venue" CFC that contains information about
performance/exhibit areas.  Some venues feature many rooms or areas.
For example Boston Common has the Frog Pond, the Brewer's Fountain, and
the Bandstand; the Boston Ballet building has 5 studios; etc

The net result is that each venue may have a single parent and may have
many children.  I'm an old hand at using "parent"/"child" processing in
SQL but am unclear how to model this in a CFC.

My first assumption was that the Venue component would have a "Parent"
property of type "Venue".  My problem occurs when a venue doesn't have a
component.  When I'm writing my "getter" I'm not sure how to handle the
returntype.

Most simple types are defaulted to the empty string - what of 

How would this normally be done?  Would you:

1) Populate the "Parent" property with a Venue object if needed, but
leave it as the empty string if not?  And then use something like "NOT
IsSimpleValue()" to determine if it's populated?

2) Populate the "Parent" property with a Venue object if needed, but
leave it UNDEFINED if not.

3) Create another property as a "gatekeeper" for this one; something
like "isChild" populated with a Boolean value?

4) Always populate the property using either a real parent or a
self-reference (in effect saying "when I'm my own dad, we're at the
top")?

5) Populate the property with an "empty venue" (one that's instantiated
but not populated)?

6) Something else entirely?

My goal, of course, is to access the object as seamlessly as possible
(having external object do a lot of "checking" on the return doesn't
seem very clean).

I guess, to make it simple, I'm asking how to best deal with optional
custom datatypes.

Thanks in advance.

Jim Davis


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137757
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

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Reply via email to