Am I correct in assuming that where I have tables thus:

Session
sessionId
name
description
enabled
sessionTypeId

SessionType
sessionTypeId
label
enabled

then my XML would look like this:

<objects>
<object name="Session">
<hasOne name="SessionType">
<relate from="sessionTypeId" to="sessionTypeId"
</hasOne>
</object>
</objects>


<objects>
<object name="Session">
<hasOne name="SessionType">
<relate from="sessionTypeId" to="sessionTypeId"
</hasOne>
</object>
<object name="SessionType" />
</objects>

Which means I can make a SessionType record but can't traverse any relationships with it. This differs from ARF's belongsTo() function, which would associate a child table with the parent, so if need be you could create a SessionType record and get the parents. I guess there's 2 things that come out of this:

1) You're probably not going to need a SessionType record unless you already have a Session record
2) If you use a SessionType object tag you can at least use a Gateway against it to get a list of the values without having to have a Session to go with it... though that refers back to item 1. I can't really think of a situation where you might want a SessionType record without having reached it via a Session record.

I see 1 and 2 as being at odds with eachother... is there any recommendation? Common sense is telling me that 1 is generally the best course of action and to leave the SessionType object tag out of the XML config unless I have a really compelling reason to get lookup table data independent of the record that is based upon it's values.

Thoughts?

Laterz,
J

The point I'm making is that there's no XML for the SessionType, unless it needs to be:

------------------------------------------------

Jared C. Rypka-Hauer

Continuum Media Group LLC

http://www.web-relevant.com

Member, Team Macromedia - ColdFusion


"That which does not kill me makes me stranger." - Yonah Schmeidler


Reply via email to