Chris Dempsey wrote:
Jason,
Try to move as much of the "construction," that is, creating objects
to as few places as possible. Look up the Factory, Abstract Factory,
and Flywheel design patterns for tips here.
One point of these patterns is that constructing objects is often a
bottleneck in the code, so if you can construct a few ahead of time,
you save a little bit of overhead. Another point of these patterns
is that constructing (calling createObject() and init()) often
requires a lot of information - the class path of the object, and
parameters required by init(), etc.
In our shop, we maintain a few server scoped factory objects.
Objects that need to create other objects ask the factories to create
and return them. Now, instead of everyone needing to know where all
of their objects are located and how they are constructed, only a few
factories need to know.
HTH,
Chris
I have DAO and Gateway factories that I use, since I use Mach-II I have
no need for a Bean/BO factory. Having a DAO and Gateways are great
because you can easily add support for different databases - all you
have to do is specify what the db type is when you init() your factory.
The factory init()s the correct DAOs or Gateways for the specific db.
I'd explain more but my relocation is occuring tomorrow and more boxes
are to be packed.
Best,
.Peter
--
Peter J. Farrell :: Maestro Publishing
blog :: http://blog.maestropublishing.com
email :: [EMAIL PROTECTED]
Create boilerplate beans!
Check out the Mach-II Bean Creator - free download.
http://blog.maestropublishing.com/mach-ii_beaner.htm
Fatal Windows Error 039: Cray not found - System Halted.
--
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]