> Well, yeah. That's a way to do it.
> Is anyone else conflicted as to how many workaround we
> should make to
> enable OOP in CF when we're already able to develop some
> pretty nice
> applications?
> -Joe
I'm an advocate of OOP but not a zealot. There are times when I see
someone create a class like this that I want to cry:
<cfcomponent name="filereader">
<cffunction name="readfile">
<cfargument name="file" type="string" required="true">
<cfset var filedata = "">
<cffile action="read" file="#file#" variable="filedata">
<cfreturn filedata>
</cffunction>
</cfcomponent>
It's usually a little more involved than that, but I have seen an
entire component not much more complex than this from someone who is
considered an advanced resource... Which essentially meant that they
were unhappy with simply having a function and so they tacked on the
extra overhead and syntactical complexity of instantiating an object
and carrying around two extra scopes, etc. all so they could read a
file...
Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written
outside of a CFC -- I've actually exchanged email about it with him,
and I still disagree... If a function is highly cohesive and is not
_logically_ part of a greater conceptual structure that would merit a
CFC, I don't buy creating a "miscellaneous functions" CFC just so that
all your functions are in CFC's. None of the ColdFusion native
functions are grouped into CFC's, even when there is a logical
association (XML functions or Regular Expression functions for
instance) and I have no problems using them either.
s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?
add features without fixtures with
the onTap open source framework
http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196446
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54