Re: Decouple SQL queries from class in OOP design
- From: "frebe" <fredrik_bertilsson@xxxxxxxxxxx>
- Date: 22 Nov 2005 09:25:54 -0800
>> In a god architecture, the database is owned by the application.
> That absolute assertion is incorrect. Many systems that provide
> significant, measurable business value are based on architectures that
> include an enterprise or otherwise shared database.
Of course there are existing applications that uses many different
architectures and still provides measurable business value. But we are
talking about how to develop new applications, right? I think most
architects agree that not every enterprise application should access
every database directly. If application A want to access data from the
database belonging to application B, application A has to interact with
application B in some other way but directly access the database
belonging to application B.
> I'm surprised you would need examples.
So why don't you give any?
> Database schemas change
> for a wide variety of reasons, including support of new applications,
> support of modifications to existing applications,
As I pointed out before, new tables or columns will not break any
existing application. But I would like to see an example of some other
kind of schema change that would be possible to encapsulate in the
persistence layer. If you remove tables or columns, I can guarantee you
that you have to rewrite your business object model too.
> and optimizations made by DBAs
Changes in indexes, caches, etc will not break any existing SQL
statemenets.
> Because SQL embedded in one application is not reusable in
> another.
If they are using the same database schema, it is obviously reusable.
> Decoupling the provision of that functionality from the
> details of how it is implemented allows the same functionality to be
> provided by a wide variety of different underlying implementations.
A database schema is not an implementation. It is an interface. The
RDBMS is an implementation. By using ANSI SQL, you decouple the
application from any specific implementation.
> Are you seriously suggesting that tightly coupling an
> application to a database schema is good practice?
Of course. Unnecessary decoupling will only cause you a code bloat. The
database schema implements a lot of business logic, and the database
schema only change when the business rules change. Still you have not
provided any example of a schema change that would only effect the
persistence layer and not the rest of the application.
Fredrik Bertilsson
http://butler.sourceforge.net
.
- Follow-Ups:
- Re: Decouple SQL queries from class in OOP design
- From: Patrick May
- Re: Decouple SQL queries from class in OOP design
- References:
- Decouple SQL queries from class in OOP design
- From: Hongyu
- Re: Decouple SQL queries from class in OOP design
- From: Robert C . Martin
- Re: Decouple SQL queries from class in OOP design
- From: Mikito Harakiri
- Re: Decouple SQL queries from class in OOP design
- From: Bruno Desthuilliers
- Re: Decouple SQL queries from class in OOP design
- From: Mikito Harakiri
- Re: Decouple SQL queries from class in OOP design
- From: Patrick May
- Re: Decouple SQL queries from class in OOP design
- From: frebe
- Re: Decouple SQL queries from class in OOP design
- From: Patrick May
- Decouple SQL queries from class in OOP design
- Prev by Date: Re: Decouple SQL queries from class in OOP design
- Next by Date: Re: agile development and frameworks
- Previous by thread: Re: Decouple SQL queries from class in OOP design
- Next by thread: Re: Decouple SQL queries from class in OOP design
- Index(es):
Relevant Pages
|