I saw Sean's post about it a while back and have never been a gateway'er but
I'm finally seeing the use.

So the question is what is the best approach here? Here is what I have:

        <controller id="PlayerController"
type="cfcs.controller.PlayerController" beans="playerService">
            <message-listener message="GetPlayers" function="load"/>
        </controller>

...[controller method]
    <cffunction name="load" access="public" output="false" returntype="Any">
        <cfargument name="event" required="true" />
        <cfset event.setValue("players",
beans.playerService.getActivePlayers()) />
    </cffunction>

...[service method]
    <cffunction name="getActivePlayers" access="public" returntype="Any">
        <cfreturn
variables.dao.getByAttributes(argumentCollection={StatusID=2}) />
    </cffunction>
<!--- dao is injected via coldspring --->

---[the beans]

    <bean id="playerService" class="cfcs.services.PlayerService">
        <constructor-arg name="dao">
            <ref bean="playerDao" />
        </constructor-arg>
    </bean>

    <bean id="playerDao" class="cfcs.dao.PlayerDAO">
        <constructor-arg name="transfer">
            <ref bean="transferFactory" />
        </constructor-arg>
    </bean>

Now, I'm curious if the gateway (or DAO in my above naming) is even needed.
It feels like an extra abstraction layer that probably isn't very necessary.
Granted in this case the code does handle a bunch of extra junk but it seems
the Service should talk with Transfer and pull the data itself. Thoughts?

Also, TransferAdapter isn't a 1:1 with Transfer.cfc. Am I missing something
there?

To resolve it I switched to transferFactory which is basically a bean
factory...well...you guys know this stuff already. lol.

<bean id="transferFactory" factory-bean="ormAdapter"
factory-method="getTransfer" />

Is it common to pull the direct transfer object (getTransfer()) or should I
learn to work with the Adapter so my code isn't bound to Transfer? On the
flip, is that the reason for the Gateway? If so, wouldn't it be the same as
having to change the service?

Anyways...I was supposed to only fool with this for a few hours but I'm
getting a bit addicted to MG. I'm def' sniffing the Glue, Dan.

---
John C. Bland II
http://www.johncblandii.com
http://www.johnandseason.com
http://www.twitter.com/johncblandii
---
Suggested sites:
http://www.lifthimhigh.com - "Christian Products for Those Bold Enough to
Wear Them"
http://www.sportsmatchmaker.com - "What are you doing today?"

--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" 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/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to