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]
To answer Sammy, I created 4 tables because I didn't want to force them
all into a single table. That is, as the application grows, one of
these entities may grow out of its schema. If this happens, I don't
want to be stuck with them all in the same table.
Teddy, I am planning on using my own service(s). I am using ColdSpring
as a service layer factory, and I've created my own factory for my
entity objects. I am planning on creating a single dao, gateway and
bean. The bean will simply hold the type (type, severity, priority,
etc). Do you see any issues with letting the dao/gateway determine
which table I should be using (i.e. dynamic FROM clause?) I've never
done this before so I'm not sure if there are any cons.
Thank you both for the information, its exactly what I was looking for.
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]