That is a very good point you bring up.  The fact that maintenance or additions
in terms of page templates will probably be done by someone else.

However i fee although there some learning curve associated with this particular
option, it is not unsurmountable.  In any case our current site uses quite a bit
of cfmodules for content pods, so there is an extra leve of abstraction that
already exist.

What i am trying to achieve in terms of layout code would be something like the
following:

cfset newLayout = createObject('component', 'model.layout_twoColumn')
cfset menuBar = createObject('component', 'model.layout_mnuBar')
cfset list = createObject('component', 'model.HTMLObject_ul'
cfset list.configure( content, "class=homepage" )
cfset paragraph = createObject('component', 'model.HTMLObject_p
cfset paragraph.configure( content, "class=homepage" )

newLayout.leftColumn.add( menuBar )
newLayout.rightColumn.add( list ) 
newLayout.rightColumn.add( paragraph ) 
newLayout.render()


newLayout.render() would return the entire layout in a string variable back to
the request scope and to a cfm container page (which would be empty).

That way as new html blocks or content area are created , we could either extend
existing class or create new ones to accomodate.  We can then catalog all our
little widgets.  

Cascading changes through our sites would therefore a lot easier, then if the
formating code was contained on cfm pages even if they were themselves templates.

Am i trying too hard to stick everything in the OO box?

Sean


Quoting Adrocknaphobia <[EMAIL PROTECTED]>:

> I've tossed the idea around of moving presentation into CFCs but I always
> come back to the same issue. That the presentation layer needs to be simple
> and have very little non-design code as possible. Usually, in a team
> eviorment, the person who is writing the HTML is not very technical. So you
> probably don't want them messing around in the cfc.
> 
> So if you are going to use CFC, figure out a way the CFC can pull in external
> HTML files, rather than have it within the CFC.
> 
> -adam
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 25, 2004 03:57 PM
> > To: [EMAIL PROTECTED]
> > Subject: [CFCDev] Presentation Layer Patterns
> >
> > I am researching at various ways to improve the way an existing
> "enterprise"
> > (aren't they all) site or app generates views.  Right now common
> presentation
> > modules (i.e unordered list or random content blocks) are stored in
> cfmodules.
> >
> > I know there has to be a better way to leverage the power of CFC along with
> some
> > design patterns for the presentation layer to create some kind of
> presentation
> > engine.
> >
> > Some of my initial thoughts are that the benefits of such a structure would
> be
> > the encapsulation of various views into parent and child classes and
> therefore
> > would allow us to effect changes on either a granular level or a global
> level
> > rather easily.
> >
> > Anyone out there care to share some of their experiences when designing
> the
> > presentation layer of their web app?
> >
> > Thanks,
> >
> > Sean Scott
> >
> > -------------------------------------------------
> > This mail sent through IMP: http://horde.org/imp/
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email
> > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> > in the message of the email.
> >
> > CFCDev is run by CFCZone (www.cfczone.org) and supported
> > by Mindtool, Corporation (www.mindtool.com).
> >
> > An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
> >
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
> 
> 




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to