MG-ColdSpring-Flex question

View: New views
2 Messages — Rating Filter:   Alert me  

MG-ColdSpring-Flex question

by Holly Jones :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've written a MG:Unity app and am using ColdSpring.  I'd like to build
a Flex front-end using the same model.  

Since MG takes care of calling ColdSpring.xml, which handles my DI, I'm
a little confused how to call functions in my model from Flex.  

I know this may be a bit off topic, but any hints would be appreciated.

Thanks in advance,
Holly

--^----------------------------------------------------------------
This email was sent to: lists@...

EASY UNSUBSCRIBE click here: http://topica.com/u/?b1drHn.b8CODV.bGlzdHNA
Or send an email to: modelglue-unsubscribe@...

For Topica's complete suite of email marketing solutions visit:
http://www.topica.com/?p=TEXFOOTER
--^----------------------------------------------------------------


Re: MG-ColdSpring-Flex question

by Doug Hughes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Holly,

In the perfect world you'd use a named bean factory.  (see Colspring.util.BeanFactoryUtils)  That way you could easily use the same bean factory in MG as in other locations.  Unfortunately, MG doesn't yet support that. 

This is a hack I've done to get ahold of the bean factory that MG uses for use with other services.  It's not elegant and provides a dependency on Model-Glue (and that MG be loaded), but it gets the job done.

    <!--- get the beanfactory.  Note, I don't like that this has to be aware of Model-Glue, but MG
    is not aware of named beanfactories so we need to get it from MG to avoid all sorts of hassles --->
    <cftry>
        <cfset variables.BeanFactory = application.root.framework.getBeanFactory() />
        <cfcatch>
            <cfthrow message="Before the RemoteListService can be used the application must first be loaded." detail="The RemoteListService depends on data loaded by the Model-Glue framework.  This framework is not currently loaded so we can't access that data." type=" Lists.model.service.RemoteListService" />
        </cfcatch>
    </cftry>
   
I've volunteered to add named bean factories to MG, but I simply haven't taken the time to figure out the best way to do this in a backwards compatible manner.

Doug

On 5/10/07, Holly Jones <h_jones2001@...> wrote:
I've written a MG:Unity app and am using ColdSpring.  I'd like to build
a Flex front-end using the same model.

Since MG takes care of calling ColdSpring.xml, which handles my DI, I'm
a little confused how to call functions in my model from Flex.




--
Doug Hughes
LightInTheBox - Buy quality products at wholesale price!