Well, I would say that you can add contact info without adding a user
(multiple contacts, right?) but you can't add a user without adding
contact info.  So, it seems to me that you first instantiate the user
and then instantiate the contact info entry, not the other way around
(i.e., AddUser() first).

Some reasons why:

1) What if you want to add a second contact later?  Your class may not
support this now, but if you want to add the ability to do it, you would
have to rework things significantly if you called AddContactInfo()
first.

2) If you call AddContactInfo() first and it calls AddUser()
automatically, what if AddUser() throws an error?  Then you are stuck
with an orphaned contact entry.

HTH,
Matthieu


-----Original Message-----
From: Baz [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 03, 2006 3:37 PM
To: CF-Talk
Subject: Adding Multiple Objects


Hi,

If I had a USER cfc and a CONTACTINFO cfc and no user should exist
without having contact info - whats a good way to add a user to the DB?

Should I call AddUser() which in turn calls AddContactInfo()?

OR, should I call AddContactInfo() first, then take the ContactID and
pass it into AddUser()?

Cheers,
Baz






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228300
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to