ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick.Wellman <Rick.Well...@kiewit.com>
Subject RE: How would you - the experts - design this?
Date Mon, 25 Jan 2010 16:15:51 GMT
I am not even sure this is worth two-cents but:
What (for lack of a better word) confuses me is the phrase "generate a
jar file that will pull out some of the data..."

>From what I can decipher, I would handle it like this.  As you say, your
data model itself is identical but the second application needs extra
constraints.  I would simply use iBatis' dynamic SQL features to write
the additional constraints into your sqlmaps.  Only your second
application would "trigger" the additional constraints.  I would imagine
that you would somehow encapsulate this into some class (or classes)
that the second application uses and the first does not.  While I could
have missed something, it just seems like you might be looking for a
solution that is more complicated than it needs to be.

Hope that makes sense and either gives you a solution or a solution to
avoid ;-)

-----Original Message-----
From: Andy Law [mailto:andy.law@roslin.ed.ac.uk] 
Sent: Monday, January 25, 2010 3:58 AM
To: user-java@ibatis.apache.org
Subject: How would you - the experts - design this?


We have built an application using iBatis to act as the interface
between
code and database (no, really :o}). As you would expect with such a
magnificent tool, it works well.

We have a different application that we are starting to ramp up. It uses
the
same data model for the most part with the same mappings from schema to
model. In fact, it actually uses the same database instance -  the
datasets
for each application are overlapping.

I'd like to maintain a single copy of the code with a single set of
SQLMaps
where possible but be able to generate a jar file that will pull out
some of
the data with extra "where xyz = 'abc'" type constraints. What is the
best
way of doing this in your experience?

To flesh out what I have described so poorly above, imagine that I have
data
from "populations" A, B and C. Application 1 needs to see data from A
and B.
Application 2 needs to see data from B and C. There is a "roles" table
and a
"populations_to_roles" table doing the many_to_many stuff and I'd like
to be
able to do all this from a single jar. FWIW, we're using maven as our
build
and management tool.

Our objects are extracted via DAOs, which come from a singleton
DAOFactory.
My current thoughts are along the lines of injecting attributes into the
DAOFactory that are then subsequently dumped into the DAOs that it
generates.

Thanks in advance for any help, ideas or discussion points that you can
provide.


Later,

Andy

-- 
View this message in context:
http://old.nabble.com/How-would-you---the-experts---design-this--tp27304
322p27304322.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message