***************************** Team Allaire *****************************
I think there's confusion on this idea of inheritance provided for by my XFB
model. You don't have to make changes in 30 different myGlobals. You only
change them in your top-level myGlobals and all subsequent circuits inherit
this. So, if you look at one of myGlobals files, you'll see lots of
cfparams. The circuit that is called sets these--then all child circuits
inherit from it.

-----Original Message-----
From: Luke Bartholomew [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 18, 2001 7:35 AM
To: Fusebox
Subject: RE: "duplicating myGlobals" (RE: RIGID STANDARDISATION IN
EXTENDE D FUSEBOX)


I understand the principle that each circuit should have everything that it
needs to run as a stand-alone app which is a great goal to aim towards, but
the fact is that in XFB is doesn't completely succeed - as you still need to
copy and re-write certain files.

For example, the app_circuits.cfm will no longer be required and the new
circuit will have to be defined in the app_circuits.cfm file of the parent
application. There is also a high probability that you will need to edit
many of your request.variables in the app_globals.cfm file, such as
request.site.cfroot etc.

The concept that I have been messing around with the last couple of days it
that there is a single app_model.cfm for each circuit which holds all the
site wide variables (as already discussed previously in this thread), and
this app_model.cfm file only fires when the circuit is the parent app. Then
each circuit also has it's own app_globals.cfm (as XFB spec states) which
over-rides any variables set in the app_model.cfm file e.g.
request.site.description or sets up a new stylesheet or javascript file in
the dsp_header.cfm.

Although I can still see problems with the solution outlined above, I am
still playing with this and believe that it may eventually provide me with a
cleaner solution to my problem, which is that with approximately 30 circuits
in my application, it is just not manageable to be forced to duplicate the
app_globals.cfm file in every circuit
app.

For example, when I move from development to testing phase, I will need to
update every reference to request.site.cfroot (and any other such variables)
in all 30 of the app_globals.cfm templates - headache. And then the
request.site.mainDSN variable needs to be changed a couple of days later -
it just doesn't seem good.

There must be a way of achieving the same goal (i.e. complete modularity and
ability to run applications stand-alone) without encountering this potential
problem).

I guess that it really depends upon which trade-offs you find most
manageable. Are there any more thoughts on this subject? :-)

Regards

Luke B.



-----Original Message-----
From: lee borkman [mailto:[EMAIL PROTECTED]]
Sent: 18 May 2001 10:17
To: Fusebox
Subject: "duplicating myGlobals" (RE: RIGID STANDARDISATION IN EXTENDED
FUSEBOX)


Well I don't know Luke, Jeff,

One of the reasons for the development of XFB is to allow complete circuit
apps to be built as stand-alone, and then integrated later into higher-level

home apps.  This cannot happen unless you put EVERYTHING that CircuitA needs

into CircuitA's myGlobals.cfm.

The idea is that every circuit has everything that it needs to stand alone,
but that it can also inherit properties from higher-level when called as
part of the higher home app.

So when I build a new circuit app, I include a full myGlobals, with some
vanilla settings from the very beginning.  I use CFPARAM and CFSET to ensure

that properties can be inherited or overridden as required.

Then when I have built and tested the circuit stand-alone, I plug it into
the home app, and lo-and-behold, it suddenly inherits my site-wide header,
footers, error messages, etc.

If you rely on a single myGlobals for your entire site, then you will have
to fiddle with that file every time you add a new circuit that requires some

new variables, etc.  That's a little dangerous.

Anyway, that's my take on it.  XFB allows circuits and home apps to
stand-alone or integrate at all kinds of levels.  That cannot happen without

a "complete" myGlobals for each circuit.

But I agree, it might seem a little counter-intuitive ;-)

Best of luck,
LeeBB
http://bjork.net

>From: "Jeff Peters" <[EMAIL PROTECTED]>
>
>Your instincts are accurate, Luke.  myGlobals.cfm shouldn't be duplicated
>throughout the site.  Rather, each circuit's file should set variables
>particular to that circuit.  Variables set by the parent circuit will be
>inherited by all children.  Each circuit has its own myGlobals.cfm to allow

>it
>to function either as a standalone module or as a circuit in a different
>application, should you decide to reuse the circuit at some point.
>
>- Jeff
>
>On 17 May 2001, at 11:00, Luke Bartholomew wrote:
......
> > Forgive me if I have missed something simple, but this does seem more
> > manageable. Why can you not have one MyGlobals.cfm file and the location

>to
> > this file is set up in the circuits.cfm file (obviously being the root
>of
> > the application) and then use app_locals.cfm (or MyLocals.cfm) for all
>the
> > variables relating to any specific fusebox. Then you could ensure that
>it
> > would only load once. Please put me straight if I am totally off track.
> >
......
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to