Hi Jared,
If you put your scope façade into the reactor blog sample, Googling brought
up the following link:
http://svn.reactorframework.com/reactor/trunk/ReactorSamples/Blog/model/util
/ScopeFacade.cfc
If I understand, you initialize this, passing an argument such as "session"
or "application" and it provides simple getters and locked setters for all
properties via a generic getvalue and setvalue. There is also getAll to dump
the scope state using a structcopy, the ability to remove a value and a
generic Exists(name: string) method.
What if any problems drove the creation of this? I kind of like the
consistency it provides as it makes getting or setting from scope like
getting or setting from any other object rather than using different syntax
(if(IsDefined("application.whatever") now just becomes another if
appScope.Exists("whatever")).
Any other practical benefits you've got from this? I like the approach and
have a feeling there may be some additional benefits I haven't thought
through yet.
Best Wishes,
Peter
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Jared Rypka-Hauer
Sent: Monday, July 10, 2006 3:25 PM
To: [email protected]
Subject: Re: [Reactor for CF] Iterator & Coldspring
Again... Record.load(id=IdValue) returns the record itself.
Sorry, I just prefer to keep my calls to things to a
minimum, so this is more a pet peeve than anything. The
code below could just be:
<cfset Contact =
reactor.createRecord("Contact").load(contactId=url.id) />
You could also create one longer like, like this:
<cfset Contact =
application.cs.getBean("reactorFactory").createRecord("Contact")
.load(contactId=url.id)>
It's still fairly readable, and yeah, it uses a lot of
method chaining, but it's also going to be a few
nanoseconds faster... heh, nanoseconds. I guess I just
don't like creating variables when I can chain a few
methods to reduce 3-5 lines of code down to 1.
Then again, in an MG controller, I usually have an ApplicationService that
uses my singleton ScopeFacade CFC and would call:
<cfset Customer = getAppVar("Reactor").createRecord("Contact).load(contactId
= contactId) />
Or something similar there-to. ;)
I think I have a link to my ScopeFacade CFC somewhere... if anyone wants it,
let me know.
Thanks,
J
On Mon, 10 Jul 2006 14:52:12 -0400
"Teddy Payne" <[EMAIL PROTECTED]> wrote:
> A more logical approach:
>
> <cfset reactor = application.cs.getBean("reactorFactory")
> />
> <cfset contactRecord = reactor.createRecord("Contact") /> <cfset
> contact = contactRecord.load(contactId=url.id)>
>
>
> On 7/10/06, Doug Hughes <[EMAIL PROTECTED]> wrote:
> >
> > Why are you using CS to configure gateways and records?
> >
> > Doug
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of Dan Vega
> > Sent: Monday, July 10, 2006 2:38 PM
> > To: [email protected]
> > Subject: [Reactor for CF] Iterator & Coldspring
> >
> > Thank you to all for the help with my iterator
> questions, everything is
> > running great & fast.
> >
> > One more quicky, I just started to learn coldspring so
> this is prolly just
> > a
> > lack of knowledge But all of reafctor components are
> setup in coldspring.
> >
> > <bean id="reactorFactory"
> class="reactor.reactorFactory">
> > <constructor-arg name="configuration">
> > <value>config/Reactor.xml</value>
> > </constructor-arg>
> > </bean>
> >
> > <bean id="ContactGateway"
> factory-bean="reactorFactory"
> > factory-method="createGateway">
> > <constructor-arg name="objectAlias">
> > <value>contact</value>
> > </constructor-arg>
> > </bean>
> >
> > <bean id="ContactRecord"
> factory-bean="reactorFactory"
> > factory-method="createRecord">
> > <constructor-arg name="objectAlias">
> > <value>contact</value>
> > </constructor-arg>
> > </bean>
> >
> >
> >
> > I am finding weird instances where this comes up, and
> the record is still
> > in
> > the database
> >
> >
> > Record Deleted
> >
> > The record you're using has been deleted. There are
> some properties which
> > will continue to function after a record has been
> deleted, but not all of
> > them. Please create a new record and go from there.
> >
> >
> > If i take away this
> >
> > <!--- get the contact --->
> > <cfset contactRecord =
> application.cs.getBean("ContactRecord")/>
> > <cfset contact =
> contactRecord.load(contactId=url.id)>
> >
> > and re instantiate the object everything works great. I
> would imagine I am
> > missing something simple about object instatnces throgh
> coldspring.
> >
> >
> > --
> > Dan Vega
> > [EMAIL PROTECTED]
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- --
> > -- --
> > Reactor for ColdFusion Mailing List
> > [email protected]
> > Archives at:
> http://www.mail-archive.com/reactor%40doughughes.net/
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- --
> > -- --
> >
> >
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- --
> > -- --
> > Reactor for ColdFusion Mailing List
> > [email protected]
> > Archives at:
> http://www.mail-archive.com/reactor%40doughughes.net/
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- --
> > -- --
> >
> >
>
>
> --
> <cf_payne />
>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- -- --
> Reactor for ColdFusion Mailing List
> [email protected]
> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- Reactor for ColdFusion Mailing List [email protected] Archives
at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --