July 2001
Intermediate to advanced
656 pages
15h 51m
English
Hard-coding SQL statements into different RDB mapper classes is not a terrible sin, but it can be improved upon. Suppose instead:
There is a single Pure Fabrication class (and it's a singleton) RDBOperations where all SQL operations (SELECT, INSERT, ...) are consolidated.
The RDB mapper classes collaborate with it to obtain a DB record or record set (for example, ResultSet).
Its interface looks something like this:
class RDBOperations { public ResultSet getProductSpecificationData( OID oid ) {...} public ResultSet getSaleData( OID oid ) {...} ... }
So that, for example, a mapper has code like this:
class ProductSpecificationRDBMapper extends AbstractPersistenceMapper { protected Object ...
Read now
Unlock full access