With regards to the following scenario...

> Here's another very realistic challenge: Let's say you have
> an employeeID. You want to display all of that employee's
> information and the manager's name and phone number on the
> same page. You have a fuseaction called getEmployee that
> returns all of the employee's information as well as the
> manager's employeeID. That's simple enough, but how do you
> get the manager's info?

I've begun to run into this all over the place.  My main issue so far has
revolved around calling the same qry file multiple times in the same
fuseaction.  My resolution has been to start calling my query fuses using
<cfmodule> instead of <cfinclude> and include the code below at the bottom
of my qry files.  I realize that qry files should only hold the query code,
but I've found that I don't adding some basic logic (i.e. I'll do a check to
see if I need a blank record, and if so, I'll use a querysim).

<!--- If called using cfmodule, pass back thru caller scope --->
<cfif ListFind(GetBaseTagList(), "CF_QRY_GETCLIENT")>
    <cfparam name="Attributes.QueryName" default="GetClient">
    <cfset "Caller.#Attributes.QueryName#" = Duplicate(GetClient)>
</cfif>

Also, I now appreciate posts where I've seen people mentioning that they
place all qry files into a separate directory since many of them end up
being called from all over the place.  I'm in the process of doing this now.

-Nelson


----- Original Message -----
From: "Patrick McElhaney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 05, 2002 4:46 PM
Subject: RE: Can you give me the 'why's' of MVC?


>
> > Hal wrote:
> >
> > Sharing data across circuits does not in my mind break any rules,
> > whereas having one fuse call another does. Of course, those are my
> > rules!
> >
> > As for lacking structure in code, gee, I don't think my code lacks
> > structure! I think that something like this makes very clear what's
> > going on:
> >
> > <cfcase value="main">
> >   <cfset addToQ( 'Company.getCurrentStockPrice' )>
> >   <cfset addToQ( 'Benefits.getSynopsis' )>
> >   <cfset addToQ( 'Training.getUpcomingTrainingEvents' )>
> >   <cfset addToQ( 'RegisteredUser.mainPage' )>
> > </cfcase>
> >
> What if I have a ticker symbol and I want get the stock price
> for that company? I dig into the company circuit and I find
> that it expects a variable called "symbol." But my form has
> a field called "tickerSymbol." I can't change it because my
> form also interacts with another circuit that expects
> the variable to be called "tickerSymbol."
>
> At the end of that request, how many unrelated variables do
> you have left in the attributes scope? What if two different
> circuits use the same variable name for different purposes,
> and those two are called in succession at some point? It's
> bound to happen sometime, right?
>
> Here's another very realistic challenge: Let's say you have
> an employeeID. You want to display all of that employee's
> information and the manager's name and phone number on the
> same page. You have a fuseaction called getEmployee that
> returns all of the employee's information as well as the
> manager's employeeID. That's simple enough, but how do you
> get the manager's info?
>
> Patrick
>
>
>
>
>
>

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

Reply via email to