The way I set up the parent was to keep all my 'shared' beans in the parent
coldspring config. So basically you would put all the beans you wanted to
access globally in the parent. So yeah you may have to move beans if they
later needed sharing. This all fit nicely into the sub-application model but
I see where you are coming from when just looking at accessing beans outside
of a single MG app.

 

I still haven't looked at the remoting service yet so will have to try it
out at some point. I just chose this method for accessing beans in certain
custom tags on a big MG2 project I worked on a while ago.

 

---

James  Allen

E: [email protected]

Blog: http://jamesallen.name

Twitter: @CFJamesAllen (Coldfusion / Web development)

Twitter: @jamesallenuk (General)

Lead developer of http://errrrrrr.com

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Dan Wilson
Sent: 20 January 2010 14:50
To: [email protected]
Subject: Re: [Model-Glue] Access to ColdSpring beans from within helpers?

 

It would be, I suppose, because the parent bean factory was born outside of
the Model Glue context.

 

I'd suppose you'd only have access to beans declared in the parent bean
factory and not in the Model Glue Coldspring factory? This would provide an
immediate way to get some of the beans, but might mean jostling beans back
and forth between factories, when those beans became useful from a remote
context.

 

I'd still recommend using the Model Glue Remote Service, because that is
what it was designed for.

 


DW

 

On Wed, Jan 20, 2010 at 9:45 AM, James Allen <[email protected]>
wrote:

If you used my first approach - using a parent bean factory, wouldn't that
be more acceptable?

 

---

James  Allen

E: [email protected]

Blog: http://jamesallen.name

Twitter: @CFJamesAllen (Coldfusion / Web development)

Twitter: @jamesallenuk (General)

Lead developer of http://errrrrrr.com

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Dan Wilson
Sent: 20 January 2010 14:40
To: [email protected]
Subject: Re: [Model-Glue] Access to ColdSpring beans from within helpers?

 

In ModelGlue 3, if you want access to the Model Glue framework remotely, you
would be best served using the Remoting Service.

 

http://docs.model-glue.com/wiki/FAQs/HowDoIDoRemoting

 

 

Accessing the framework like: application._modelglue is not recommended.

 

 

DW

 

On Wed, Jan 20, 2010 at 9:38 AM, James Allen <[email protected]>
wrote:

There will most likely be a better way to do this in MG3 but in MG2 I got
around this by running my own CS bean factory from my application.cfc. I
then pointed MG2 at this as the parent bean factory. It was to be a way to
share beans between sub applications but also came in very handy for model
access from outside the framework. E.G:

<cfset service = application.bf.getBean("service")>

I'm sure someone will have a better way to do this utilising something in
MG3 though.

In fact I have a feeling... Hmmmmm, think I did this recently. LOL.. I'll
check my codebase.

Ah yes, here is the way to get the BF from MG itself:

application._modelglue.getInternalBeanFactory()

:)

---
James  Allen
E: [email protected]
Blog: http://jamesallen.name
Twitter: @CFJamesAllen (Coldfusion / Web development)
Twitter: @jamesallenuk (General)
Lead developer of http://errrrrrr.com


-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Sir Rawlins
Sent: 20 January 2010 14:32
To: model-glue
Subject: [Model-Glue] Access to ColdSpring beans from within helpers?

Hello Guys,

I need access to beans configured in ColdSpring from within my MG 'helpers'
methods, is CS available in any way? what would be your suggestions.

Thanks,

Rob


--
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]
<mailto:model-glue%[email protected]> 
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en




-- 
"Come to the edge, he said. They said: We are afraid. Come to the edge, he
said. They came. He pushed them and they flew."

Guillaume Apollinaire quotes


--
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]
<mailto:model-glue%[email protected]> 
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en




-- 
"Come to the edge, he said. They said: We are afraid. Come to the edge, he
said. They came. He pushed them and they flew."

Guillaume Apollinaire quotes

-- 
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