This brings up an issue of how to use the data I'm returning.
lets keep it simple and say that a Contact has properties of id,
notifydate, userid, contactmethod and PhoneContact has id, contactid,
phonenumber, message and EmailContact has id, contactid, toaddress,
subject, body
My first thought is that I get grab a Contact and get back a structure
like this:
id
notifydate
userid
contactmethod
content(obj) ---> id, toaddress, subject, body (if email) OR id,
phonenumber, message (if phone)
In that scenario, every contact I get back will look the same. A
notifydate, the person to notify, the method and then an object with
the contents of the contact to be made.
It sounds like you are suggesting though is that
getAbstractContact(103) would return a different looking object
depending on if that particular contact was of type phone or email,
correct?
Thanks,
Judah
On Wed, Nov 12, 2008 at 4:50 PM, Jaime Metcher
<[EMAIL PROTECTED]> wrote:
>
> Hi Judah,
>
> That sounds about right. So you'd have something like:
>
> getContactByID(id):
> // whatever arrangement you have for grabbing the right record out
> of the database
> query = select from Contact left join PhoneContact left join
> EmailContact where ContactID = :id
>
> if (query.contactType is "phone")
> return CreateObject("PhoneContact").init(query.Field1,...)
> else if (query.contactType is "email")
> return CreateObject("EmailContact").init(query.Field1,...)
>
> The PhoneContact and EmailContact objects would be inheriting some of those
> fields from Contact. The main point is that you ask for a Contact, but what
> you actually get back is on of the subtypes.
>
> Jaime
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---