Hi Jaime,
Funny enough, I posted about this a little while back at
http://www.codeodor.com/index.cfm/2007/1/15/More-classes-in-other-languages-than-in-CF/877.
I discussed more from the point of view of having fewer classes, and
thought that I may be subconciously writing bad code for two possible
reasons (well, I didn't re-read the post for this, but this is what I
think I said):
1) I may be concerned in the back of my head about the overhead
2) It may be just some bad habits in CF, as I tend to have many more
objects in Java (for instance)
-Sammy Larbi
Jaime Metcher wrote:
Hi,
When you're modelling your application, how much attention do you pay
to minimizing the number of objects instantiated? Obviously CF has a
higher object creation overhead than some other languages. OTOH, the
gist of much OO practice (and many patterns) is to create lots of fine
grained objects. I often read that a typical noob error is creating
too few objects with too many responsibilities.
So, how often do you find yourself thinking "well, in Java or
Smalltalk I'd do xyz, but in CF I'd better not because I'd end up with
too many objects"? Which is another way of asking to what extent we
need to modify existing OO practices to allow for CF's limitations.
A couple of points of reference:
1. This post was prompted by a discussion with Mark Mandel on the
transferdev list. I'd spotted an issue purely because of the massive
slowdown that occurred when 700 objects were inadvertently created.
That issue has been resolved, but it left me wondering, if I can't
instantiate 700 objects how many can I create? 10? 50? This has
huge implications for how we architect our apps.
2. I have a Dolphin Smalltalk image that, from a fresh install,
reports instantiating 160,000 objects. Obviously with an object
system this slick you don't worry much about throwing in a few hundred
more. Given that CF's comfort zone is probably a couple of orders of
magnitude lower, maybe a lot of the standard advice on OO design just
doesn't apply to CF?
Any thoughts appreciated.
Jaime Metcher
You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org