Re: Decouple SQL queries from class in OOP design
- From: "Ilja Preuß" <it@xxxxxxxxxxxxx>
- Date: Sun, 20 Nov 2005 10:40:39 +0100
Mikito Harakiri wrote:
> Robert C. Martin wrote:
>> On 9 Nov 2005 17:35:50 -0800, "Hongyu" <forward@xxxxxxxxxx> wrote:
>>
>>> To my knowledge, in OOP design it's not good to mix SQL queries with
>>> application codes in classes, because it limits the usability of the
>>> classes and bound them to the local database schema.
>>
>> Indeed, it is not good to mix SQL with business rules in *any*
>> paradigm. You'd like your business rules to know nothing of SQL.
>> You'd also like your business rules to know nothing of the relational
>> schema. The business rules want to use a convenient set of data
>> structures (or objects).
>
> Cool. When I forget my badge and show
> up at the front door and give them my employee ID, it is sure nice not
> to have an
> EMP table and query it directly, but send a message to each and every
> DEPT
> instance to ask "does emp 1234 work for you?"
False Dichotomy.
Take care, Ilja
.
- 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
- Decouple SQL queries from class in OOP design
- Prev by Date: Re: agile development and frameworks
- 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):