> Sean Corfield wrote:
> But the HTML UI layer here - that matches the Swing UI layer Holub
> refers to - is an abstraction layer that knows nothing about your
> application objects. 'drawThyself()' would be a method on your business
> object that calls the abstract HTML UI layer to render information
> (into HTML). In other words: no business logic/knowledge in the HTML
> layer and no HTML in the business layer - which is how Swing apps
> essentially work. We just don't have an HTML equivalent to Swing.
Using XML to describe a page, and the XSL to convert it to "something" would
be somewhat analogous. drawThyself() would return XML, and then the
presentation layer object would do the needed transformations to make it
display specific (which might be converting to HTML, WAP, or whatever).
I've not done it with a CFC-based implementation, but I've used nearly an
identical algorithm with great success for various things. This code needs
refinement, but it illustrates the idea.
User.cfc
--------
public string drawThyself() {
return "<panel><title>" & getFullName() &
"</title><body>...</body></panel>";
}
Display.cfc
---------------
public string generateHTML(xml) {
arguments.xml = xmlParse(arguments.xml);
return xmlTransform(xml, variables.html_xsl);
}
public string generateWAP(xml) {
arguments.xml = xmlParse(arguments.xml);
return xmlTransform(xml, variables.wap_xsl);
}
---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax : 360.647.5351
www.audiencecentral.com
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Sean A Corfield
> Sent: Friday, September 12, 2003 12:12 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] DB and OO question
>
>
> On Friday, Sep 12, 2003, at 07:20 US/Pacific, Brad Howerter wrote:
> >> Except that having generic property accessors like that breaks
> >> encapsulation even more (since client code can access *any* instance
> >> data!).
> > No, not any instance data, just the preoprties defined with CFPROPERTY.
>
> So your get/set methods introspect the object every time to validate
> whether the property is accessible / updatable? Interesting approach.
> Don't you find it rather slow?
>
> >> 'drawThyself()' doesn't generate HTML. To map his scenario to web
> >> applications and CF you'd need an HTML UI layer that applications
> >> called into in order to render pages - you wouldn't have HTML
> >> fragments
> >> in your 'drawThyself()' methods.
> > What else is there for it to do? Wouldn't the drawThyself method be
> > in the
> > HTML UI layer?
>
> But the HTML UI layer here - that matches the Swing UI layer Holub
> refers to - is an abstraction layer that knows nothing about your
> application objects. 'drawThyself()' would be a method on your business
> object that calls the abstract HTML UI layer to render information
> (into HTML). In other words: no business logic/knowledge in the HTML
> layer and no HTML in the business layer - which is how Swing apps
> essentially work. We just don't have an HTML equivalent to Swing.
>
> Sean A Corfield -- http://www.corfield.org/blog/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word '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]
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word '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]