Hi Andrew,
First, I'll just ask the obvious question: why do you have 4 identical
tables?
Now, supposing you have a good reason, I'll chime in with what I would
do: I'd keep it all in one class. There is this thing called YAGNI,
which means "you aren't gonna need it." It's one of my favorites which
has saved me a lot of hassle. In the interest of keeping unnecessary
complexity out of your code, don't look to split these into 4 classes
until you need 4 classes. If they all have the same behavior now, there
is no reason to break them apart - you can easily do that if you ever
need to.
Cheers,
Sam
Andrew Duckett wrote:
Andrew Duckett wrote:
This is more of a design question than a ModelGlue specific
question. I'm working on an application where I have multiple tables
(4 to be exact) that are identical: type, status, severity,
priority. They all contain the same columns. I'm trying to decide
if it would be more beneficial for me to create separate bean, DAO
and Gateway objects for each of these or if I should just create a
single bean, DAO and Gateway to handle them all. The only difference
would be which table the dao and gateway would be using. I realize
this isn't a huge deal, and either would get the job done. This is
more of a pet project I am working on to help me better understand
design patterns. Do any of you have any suggestions or pros/cons
about either approach?
Thanks!
Andrew
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/[email protected]
Oops, forgot to take the ModelGlue part out, sorry about that.
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/[email protected]
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/[email protected]