Deanna wrote:
Well, you could have some object aggregation. So, for example, the user CFC
could have an instance of the newsletterManager cfc. So, if a new user is
created, and they've requested access to certain newsletters, you'd just run
the functions from within the user cfc. Or, if you instantiate a user as an
object, there should be a "getId()" function that can be called once it's
been instantiated. Then, use that id in a separate call to the newsletter
cfc.

Deanna and James,
Because I am new to CFC's and OOP, could you help me understand how to
implement the advice above?

This is what I am guessing I should do:

Inside the insertUser method of the users component, I should invoke
the insertSubscriber method of the newsletter manager component and
pass it the userID. Is that it?

Would it look like the following code?

<!--- Check if user has subscribed to any newsletters. If so, insert them --->
                <cfif (arguments.userMailingListID) IS NOT "">
                        <cfinvoke
                         component="WhiteHorse.components.newsletter"
                         method="insertNewsSubscription"
                         returnvariable="insertNewsSubscriptionRet">
                                <cfinvokeargument name="user_ID" 
value="#arguments.userID"/>
                                <cfinvokeargument name="newscat_ID" 
value="#arguments.userMailingListID#"/>
                        </cfinvoke>
                </cfif>

Your help is greatly apreciated!
-Aaron


On 2/11/06, James Holmes <[EMAIL PROTECTED]> wrote:
> The MAX(ID) technique only works 100% if you use a serializable
> transaction in the cftransaction tag, which can impact performance.
>
> On 2/12/06, Mike Soultanian <[EMAIL PROTECTED]> wrote:
> > If you're sure about that, go with it.  However, from a previous
> > conversation, it didn't seem that was the consensus... but I could very
> > well be wrong...
> >
> > Mike
> >
> > Aaron Rouse wrote:
> > > It does a transaction in the database itself, assuming the database being
> > > used supports transactions.  This would ensure that you get back the ID 
> > > that
> > > you just inserted.
>
> --
> CFAJAX docs and other useful articles:
> http://jr-holmes.coldfusionjournal.com/
>
> 

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