[fpc-pascal] Looking for a Firebird book?
Inoussa OUEDRAOGO
inoussa12 at gmail.com
Wed Apr 9 22:55:24 CEST 2008
Hi,
2008/4/9, Graeme Geldenhuys <graemeg.lists at gmail.com>:
> On 09/04/2008, Bee <bisma at brawijaya.ac.id> wrote:
> >
> > I used to think that way too. But, based on my personal experience, in
> > certain conditions and requirements, implementing logic in database is
> > inevitable. That's why many databases support server side logic though it's
> > implemented in various ways (UDF, SP, SF, etc).
> >
> > But I also agree that we shouldn't use this mechanism at all time. Each
> > decision and choice has its own consequences. ;)
>
>
> The reason we stopped using stored procs..... The speads business
> rules across layers.... Business rules do no belong in the storage
> layer - the same reason business logic does not belong in Forms (gui
> layer). If they are mixed like that, you cannot write unit tests for
> them and makes it very hard to debug business rules!
Why couldn't SP be unit tested ? I did it myself numerous time. Tests
do not have to be
written in Object Pascal.
> But as I said in a earlier post, that's a whole other discussion, and
> I have no interest in starting a flame war. :)
Stored procedures have their uses, they should not be abused as OOP
should not be abused. Making the business rules in the middle layer
is a good point, but it should not be done at any price; I saw some
code where data are selected and sorted on the middle layer because
of _this_ rule and make the application _very slow_ and consume
too much memory (it could has
been done very efficiently with a few sql commands in a SP).
I do think thatevery method, technic must remain a mean, not a goal.
Thanks.
--
Inoussa O.
More information about the fpc-pascal
mailing list