One reason might be that fact that the iterator creates dependencies in application layers above the services if you use it… having it in a Gateway is one way of isolating it so it is not hardwired to the object.

 

Shannon

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Hughes
Sent: Tuesday, March 21, 2006 7:30 PM
To: [email protected]
Subject: RE: [Reactor For CF] is the idea of an iterator in a gateway flawed?

 

Why do that when there already exists an Iterator object? 

 

<cfset ThingIterator = reactorFactory.createIterator(“Thing”) />

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shuck
Sent: Tuesday, March 21, 2006 7:24 PM
To: [email protected]
Subject: [Reactor For CF] is the idea of an iterator in a gateway flawed?

 

I was talking to a fellow developer about Reactor today and he asked if a gateway had the ability to return not only a query, but possibly an array of instantiated objects.  My knee jerk reaction was that this is normally not done and gateways normally return query recordsets, but I couldn't answer the "why not?".  Is it a bad idea for there to be some type of getIterator() in the gateway that accepted a query recordset along the lines of:

<cfset ThingGateway = Reactor.createGateway("Thing")  />
<cfset ThingIterator = ThingGateway.getIterator(ThingGateway.getAll()) />

I haven't really worked through this thoroughly and I am fairly certain that there must be a reason this isn't done, but could someone explain it?

If there isn't a reason this shouldn't be done, is this something that could be considered?

Thanks!

--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz -- 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/

Reply via email to