Hey Andrew!

Yeah, scary as it is, I've been developing CF "stuff" for sheesh... I
don't know, a while. Maybe >8 years... yeooowch!  I should be way more
awesomer (I feel, but hey)!

I also think there is something not quite right in my head, because
I've done a lot of different stuff, instead of just picking something
and running with it.  I think it's like ADD, but mellow ADD or
something.  And my memory is strange.  Anyways...

I think I mentioned how you'd have to add a flag if you wanted to work
with XML or AJAX, to suppress output in those cases.  I do have some
white space removal, and some "before the doctype" (stupid XML thing
IIRC) whitespace removal going on in the project I used that idea
with, which was fun, as I'd always disliked the abundance of
blankspace in CF generated stuff.

Mostly I'd shy away from the onRequestStart for another reason... I
can't remember what that reason is, but I think there was something...
anyway.  Your zip thing, I like mucho! Nice POC!

In another site I did the template thing, which works well as well, if
that isn't too many wells in a row (I know, deep subject :).  And on
others I've done dynamic CSS, which can be pretty good too (it's nice
when you can link it to fckeditor and have a db interface for editing
the styles... I got 1/2 way there, as usual).

Mostly those functions (onRequest & end) seemed exactly what I was
looking for, and in fact, were.  They "did the job", and it seemed
that was a job they were designed for.

I too don't think I'd go that route again, mostly because I've already
done it, and now I know, in depth, just what it takes to use a
"mentality" like this.  I think the biggest issue is with the
mentality of it, vs. the "how to" of it. (I like MG for doing this
stuff, it's got the same things you'd end up doing anyway, I reckon
(or at least the idea of MG, as I'm still picking it up!))

There are lots of ways of accomplishing this stuff. As many as one
could think, and one could think a lot, I'd wager.  The CFC is nice,
but brings it's own troubles.  Really, every way has it's plus and
minus, and maybe that's why I have trouble running with just one.

Those onRequests are a convenient hook, I have to acknowledge! And I
don't think there's anything stopping you from applying the stuff you
talk about (foresight) to any method of "getting it done" that one
chooses.  I am getting better at predicting the future tho!

I don't know, I've coded myself into so many corners with every idea
I've tried... there is always /something/ you want to do that's
"outside" the bounds.  I guess I take some sort of sadistic pleasure
in not finding that silver bullet yet.  I do, on average, find "a way"
to make X work with Y though.  Yeah, there's always a way.  And the
journey is the fun part anyway, they say.  Right? RIGHT!!! :-)

Yes, I'm a lazy programmer! I will code 4 hours on some code to do
something that I could have hand entered in 1.  Don't laugh!  It
sometimes does save some time down the line! Enough to justify my
existence? Well... I'm biased. Sickly biased. ;-)

I think you'll find other areas where onRequest start and end are used
to do the pre and post logic of, well, the request.  I didn't say you
had to physically put the header in there, so to speak.  It could be
header.cfc or styleWrapper.cfm or whathave you... some object....

Out of curiosity, what way are you favoring at the moment?
Frameworks, custom wrapper thingies, dynamic CSS...  little of all of
these ('cept for onRequestStart, oc ;) ?

Thanks though, I see where you are coming from and sorry if I come off
too flippant!
:DeN

On 10/4/06, Andrew Scott <[EMAIL PROTECTED]> wrote:
> Denny,
>
> As a developer who has been developing coldfusion applications now for 11
> years, let me say this. Although the onRequestStart and onRequestEnd in
> Application.cfc is a good method for very lazy programmers, or if you're
> header and footer information never changes, but consider this.
>
> Custom Tag: If you developed a custom tag that could create the template
> required, you then have something that you could reuse in other sites by
> changing the style sheet, and minimise your work.
>
> But the biggest down side to the Application.cfc method you described, is
> you would never be able to introduce Ajax, or even webservices into your
> application or any form of Flex functionality.
>
> So think about how you want to expand your application first, or if you have
> to expand your application in the future and what problems you might have in
> doing this before deciding any solution to be the best.
>
> My advice would be to never use onRequestStart or onRequestEnd in that way
> to do header and footer processing.
>
> However if you would like to see an example of how one might use
> onRequestStart and end have a look at this. It has been constructed as a
> proof of concept, but it shows the power that you have and removing white
> space in this example is easy enough too.
>
> http://www.andyscott.id.au/index.cfm/2006/9/12/Proof-of-Concept
>
>
> Senior Coldfusion Developer
> Aegeon Pty. Ltd.
> www.aegeon.com.au
> Phone: +613  8676 4223
> Mobile: 0404 998 273
>
>
> -----Original Message-----
> From: Denny Valliant [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 5 October 2006 8:26 AM
> To: CF-Talk
> Subject: Re: Headers and Footers
>
> On 10/3/06, Teddy Payne <[EMAIL PROTECTED]> wrote:
> > If you use Application.cfc, you can use the onRequest method to intercept
> > your page loads.
>
> I've used onRequestStart and onRequestEnd to add headers and footers,
> works quite well aside from the fact that you then need a variable
> when you don't want the header/footer, like for XML stuff for JS or
> whathaveyou.
>
> I don't like the <cfinclude> on each page much for the reason I don't
> like DW templates.
> I'd way rather have a <cfinclude> than a DW template though... you can
> be pretty sure a global find and replace will catch the whole bit you
> want.
> *
> Yeah, ModelGlue takes care of this stuff, and many other nifty issues,
> quite readily.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255598
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to