One idea that hasn't been talked about yet is the concept of a Parent Bean Factory in ColdSpring. As you know, your MG application instantiates a bean factory from ColdSpring. By using a Parent Bean Factory for your CS bean factories in App1 and App2, you can share instances of objects without having to try to communicate across scopes.
In a situation where the ColdSpring bean factory in your MG application has a Parent Bean Factory, dependancies are resolved by looking in the child factory first, the parent second. That means you need to create your cache object in the single Parent Bean Factory and not in either of your ModelGlue CS bean factories. For more information on how to implement this: http://www.coldspringframework.org/docs/BeanFactory_Reference.htm Section: II.VIII Hierarchical Bean Factories Let me know if you go this route, and I'll add more detail. DW On Wed, Sep 10, 2008 at 7:28 AM, Andrew Myers <[EMAIL PROTECTED]> wrote: > > Hi Mike & Chris, > > Thanks to you both for your suggestions. > > Basically app1's application scope has an instance of a CFC which > holds a Struct which in turn will contain various frequently used > variables - they can be anything from queries to HTML fragments. > > I think Chris's suggestion might be the best option without having to > entirely re-architect my application. I could probably use a cfhttp > call to a page which in turn calls a "refresh" function. > > That might be the simplest way to go I think... > > Andrew. > > 2008/9/10 Mike Brunt <[EMAIL PROTECTED]>: > > > > Andrew a quick question, specifically what variables or kind of > > variables (DSN etc?) do you want to share I think that is important to > > know. Also bear in mind that the internals of ModelGlue are retained > > in the Application scope. What you might consider is using the Server > > scope but you would have to be careful in my opinion and only put > > those variables that have to be shared between CFApplications. > > > > Kind Regards - Mike Brunt > > > > On Wed, Sep 10, 2008 at 1:51 AM, Andrew <[EMAIL PROTECTED]> wrote: > >> > >> Hi, > >> > >> I currently have a web project that is structured something like this: > >> > >> <CF_ROOT>/ (let's call this "app1" - it's not a model-glue app) > >> Application.cfc > >> index.cfm > >> etc. > >> > >> <CF_ROOT>/administration/ (let's call this "app2" - this is a model- > >> glue MG:U app) > >> Application.cfc (a model glue app) > >> config/ > >> controller/ > >> views/ > >> etc. > >> > >> I have just written a caching mechanism which is put in application > >> scope of the "app1". What I had hoped to do was to refresh the data > >> when it's updated by in the administration section (ie. "app2"). But > >> now I've realised that app2 has a different application scope to > >> app1... > >> > >> Is there any way for app2 to access the cache I have in app1? > >> > >> I did find this suggestion via google but I'm not sure how it'll work > >> when I'm using MG: > >> > >> > http://www.bennadel.com/blog/1247-Ask-Ben-Dynamically-Executing-ColdFusion-Application-cfc-Instances.htm > >> > >> Any thoughts or suggestions on how I can best tackle this problem, or > >> whether my architecture is just completely flawed (stupid > >> perhaps? :-)) > >> > >> Thanks, > >> Andrew. > >> > >> > >> > >> > > >> > > > > > > > > -- > > Kind Regards - Mike Brunt > > Senior Server Engineer > > Cell: 562.243.6255 > > MSN: [EMAIL PROTECTED] > > > > > > > > > > > -- "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 --~--~---------~--~----~------------~-------~--~----~ 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 For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
