Re: in need of a pattern
- From: "zix" <bmcandrews@xxxxxxxxx>
- Date: 9 Jun 2006 12:52:02 -0700
H. S. Lahman wrote:
A classic problem of changing one's mind about persistence mechanisms.
You got that right!
I am less sanguine about a conversion that "wouldn't be much" trouble.
Applications that old typically do not have good application
partitioning and the persistence access code would littered throughout
the solution logic.
True.
Thanks for the UI analogy, it really helps. But,...
So what you need is a strategy for identifying things that can be used
consistently by both the problem solution and the RDB access. But since
the abstraction are quite different (Student/Graduating Year vs.
Table/Attribute), each regime interprets that identity differently.
Once the identity strategy is defined it becomes relatively trivial to
provide the initialization data for constructing things like SQL
strings. However,...
Confused about the "indentity strategy". Is this a mapping between
Student/Graduating Year in the problem solution and the mechanism for
looking up a Student and Graduating Year in the persistence access
solution (which for a RDB would probably be a Table and a column )?
Alas, I'll bet the existing application has nothing close to that level
of isolation in the application partitioning. So to get where you need
How'd you ever get that idea :)?
If you choose to go the subsystem/layer route then I strongly suggest a
piecemeal strategy. First design the interface. Then insert it into
the existing application around the existing data access code. That
allows you to do full regression testing to make sure that the interface
itself hasn't broken anything. (Most of the refactoring will be in this
step.) Once you can access the old data persistence with the new
interface, design and implement the new RDB access subsystem to service
the new interface you have designed. Since it has a pure data transfer
interface you can thoroughly test it outside the application context.
Then the only thing left if to excise the old access code and plug in
the new subsystem.
Thanks for the advice.
Bonus: if you design the persistence access subsystem generically around
the RDB invariants (Table, Tuple, etc.) and you provide external
configuration data for identity (e.g., to plug into SQL strings), you
will find that you can reuse that subsystem for different applications
that access an RDB. For the reuse context you just need to provide a
new interface and new configuration data for identity. All the
implementation details like constructing SQL strings and decoding
datasets should pretty much Just Work in the new context.
Once again, not sure about "configuration data for identity".
[BTW, my blog deals with several of these issues in various categories.]
heading over there right now.
Thank you for your thoughts and the time it took to transcribe them.
Brian
.
- Follow-Ups:
- Re: in need of a pattern
- From: H. S. Lahman
- Re: in need of a pattern
- References:
- in need of a pattern
- From: zix
- Re: in need of a pattern
- From: H. S. Lahman
- in need of a pattern
- Prev by Date: Re: OO and RDB war : in the advent of MRAM
- Next by Date: Re: help with object design for a database
- Previous by thread: Re: in need of a pattern
- Next by thread: Re: in need of a pattern
- Index(es):
Relevant Pages
|