Re: Decouple SQL queries from class in OOP design
- From: "Mikito Harakiri" <mikharakiri_nospaum@xxxxxxxxx>
- Date: 21 Nov 2005 10:43:27 -0800
Bruno Desthuilliers wrote:
> Mikito Harakiri a écrit :
> (snip)
> >
> > 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?"
>
> Is there any reason the OO code should do such a stupid thing (apart
> from having been designed by a stupid designer and coded by a stupid
> coder) ?
What is so stupid about it? Does the application meet the required
functionality? Yes it does. Yet, why almost every application
performance group meeting discusses a case like this?
> Anyway, I wouldn't let the guys at the front door have to manually issue
> SQL queries - I would provide them with a nicer user interface !-)
This is why application programming is not a fad. Still, I hardly see
any objects involved:
boolean isValidEmployee( int empNo ) {
//wrap around "select count(*) from emp where emp# = :empNo"
}
OK, boolean more realistically is a record with picture, first and last
names fields, but I digress. Tell me a single reason why this SQL query
shouldn't be embedded in this function.
.
- Follow-Ups:
- Re: Decouple SQL queries from class in OOP design
- From: Robert C . Martin
- Re: Decouple SQL queries from class in OOP design
- From: JXStern
- 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
- Decouple SQL queries from class in OOP design
- Prev by Date: Re: agile development and frameworks
- Next by Date: Re: Decouple SQL queries from class in OOP design
- 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
|