I agree. I've seen too many cases of files that are over 500 lines long, contain 20 or more CFIFs (many nested and renested) that are really hard to maintain.

I've found it better to create custom tags and CFCs acting as objects and widgets and reuse them. This way if there is a problem with the business logic in one place, all I have to do is make the change in a single place. I'll even place querries and stored proceedure calls in seperate files, inside a seprate folder!

In my mind this is much easier to maintain, especally if my client wants small cahnges toward the end of the development cycle. As a general guidline, I try to aim to have my files shorter than 225 lines.

This is especally important if you work within a team environment with maintenance programmers.

Jeremy Brodie
Intelix
an Edgewater Technology Solutions Company

web: http://www.edgewater.com
phone:(703) 815-2500
nasdaq symbol: EDGE

>big self-contained files.
>
>I used to do that. Then I stopped doing that.
>
>The files were getting *VERY* big, and some things were not that easy to
>reuse over the application -- and if you start doing includes/tags then it
>is not contained in one file anymore. I actually found things harder to
>maintain in a lot cases since you have to find your way through the web of
>code in one template that did a lot of different things.
>
>I started to gravitate towards something like fusebox 3. I used a
>dispatcher (all calls to index.cfm), I split things up in individual
>templates. Then I found fusebox 3, and it was a big "this is for me". I
>could see how things would be easier to maintain, reuse, transpose etc
>etc.
>
>But before I got really into fbx 3; big things are happening now -- at
>work we are moving to CFMX and it seems like Mach-II is *the* thing to
>move to.
>
>/Hugo
>
>
>
>
>-------------------------------------------------------------
>Hugo Ahlenius                  E-Mail: [EMAIL PROTECTED]
>Project Officer                Phone:            +46 8 230460
>UNEP GRID-Arendal              Fax:              +46 8 230441
>Stockholm Office               Mobile:         +46 733 467111
>                               WWW:       http://www.grida.no
>-------------------------------------------------------------
>
>
>
>
>
>
>| -----Original Message-----
>| From: cfhelp [mailto:[EMAIL PROTECTED]
>| Sent: Friday, November 07, 2003 17:12
>| To: CF-Talk
>| Subject: RE: Just Wondering Why
>|
>|
>| As a practice I try and make each template self contained
>| (You can open it
>| with the browser by its self).  All Queries, Set Params and
>| output all in
>| one file. Makes troubleshooting easier and reusable code.
>|
>|
>|
>| Rick
>|
>|
>|
>|   _____
>|
>| From: Kwang Suh [mailto:[EMAIL PROTECTED]
>| Sent: Friday, November 07, 2003 1:17 AM
>| To: CF-Talk
>|
>|
>|
>| This behaviour is not specific to fusebox.  CF just works this way.
>| included templates are not automatically parsed.  You have to have
>| <cfoutput> tags in the included page.
>|
>| -----Original Message-----
>| From: Mickael [mailto:[EMAIL PROTECTED]
>| Sent: November 6, 2003 8:52 PM
>| To: CF-Talk
>| Subject: Just Wondering Why
>|
>| Hello All,
>|
>| Sorry if this is a novice question.  I am trying to learn
>| fusebox and find
>| my self making smaller templates and and more includes (which
>| I guess is
>| good I haven't decided yet)
>|
>| My question is this.  Lets say that the value of myvariable is "house"
>|
>| So when I do this
>|
>| <cfoutput>
>| #myvariable#
>| </cfoutput>
>|
>| I get an output of house
>|
>| But when I do this
>|
>| <cfoutput>
>|
>| <cfinclude template="dsp_myvariablepage.cfm">
>| (dsp_myvariablepage.cfm's
>| content is  #myvariable# )
>|
>| </cfoutput>
>|
>| I get #myvariable#  instead of house.  If include the template and the
>| content is #myvariable# would it not be in between the two
>| cfoutputs once it
>| is included?
>|
>| Sorry if this question is basic, just trying to understand it.
>|
>| Thanks
>|
>| Mike
>|
>|   _____
>|
>|
>|
>|
>|   _____
>|
>|
>|
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to