Re: Decouple SQL queries from class in OOP design




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.

.



Relevant Pages

  • Re: Stories that made you cry
    ... >"The girl was dumb, and in space, being dumb can get you ... She looked at a door that said "Authorized ... Thinking that the warning sign is just there because the grumpy meanies ... And when the stupid girl wants a private place to gaze longingly into ...
    (rec.arts.sf.written)
  • Re: Smaller ATX case?
    ... it was a good idea but now I think its pretty stupid. ... I was wondering if there are any ATX mid-tower ... cases had that stupid front door on them. ... There's a PC-60 on ebay that I'll bid on and see what happens. ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: the party is over - bioshock cracked
    ... Not really a true analogy though is it. ... Locking my front door has no affect on anyone apart from me and anyone who would try to break in. ... So perhaps you should read what you posted and not post your tired and stupid reply which has absolutely no relevance to the thread. ... I don't know whether it works or not therefore I don't choose to make stupid statements that it does or doesn't work - I mean what sort of idiot would do that? ...
    (comp.sys.ibm.pc.games.action)
  • Re: AMC-One more comment on Fridays episode 9/30
    ... >> home-made stake she made out of the table leg. ... who proceeded to lock the door and tell her that no one knew about ... rushes out without even knowing who is opening the door, screaming her head ... I have no sympathy for her problems, because she's so stupid. ...
    (rec.arts.tv.soaps.abc)
  • Re: OT: Wake Up And Smell The Invasion !!!!
    ... That'd just be STUPID. ... One left his blood on my broken window either ... propping the screen door open with the trash can. ...
    (rec.crafts.metalworking)