Re: Where do business rules belong... OCP and SPs
From: Yaron Bental (bentalcy_at_yahoo.com)
Date: 01/22/04
- Next message: Michael N. Christoff: "Re: Mars Rover Controlled By Java"
- Previous message: Isaac Gouy: "Re: OOA?"
- In reply to: Robert C. Martin: "Re: Where do business rules belong... OCP and SPs"
- Next in thread: Rod Davison: "Re: Where do business rules belong... OCP and SPs"
- Reply: Rod Davison: "Re: Where do business rules belong... OCP and SPs"
- Reply: Robert C. Martin: "Re: Where do business rules belong... OCP and SPs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Jan 2004 16:29:10 -0800
Robert C. Martin <unclebob@objectmentor.com> wrote in message news:<unnr00dvr86nq8snkbj9gvu5dt79g4gij2@4ax.com>...
> On 18 Jan 2004 20:38:36 -0800, bentalcy@yahoo.com (Yaron Bental)
> wrote:
>
> >Hi
> >
> >Being an OO follower I believe, and I know a few other do too,
> >business rules belong in the business tier, we all know the reasons.
> >With that habit in mind and in practice I set some time this week to
> >improve performance on a very slow page in one of the apps my team is
> >responsible for. I knew I have to touch a set of stored procedures and
> >in my mind I thought I wanted to move all the business rules captured
> >in the stored procedures back to where I think they belong.
> >
> >No meter how hard I tried I could not move those rules into the middle
> >tier, performance would just degrade. Some of the stored procedures
> >filter (using some very complex business rules) through hundreds of
> >thousands of records. Simply moving this data into some classes and
> >filtering/calculating it there, just doesn't make sense, from
> >performance point of view.
>
> The back end server can do some things much much faster than the
> middle tier. That's just the nature of the beast. That means that
> there will be some things that you must delegate to the back end.
> However, that doesn't necessarily mean that you have to move too many
> business rules down there.
>
> First, try to limit the stored procedures to only those things that
> are slow. Then see if you can abstract any reference to business
> rules away from them, so that they become pure mechanism. The more
> you can view them as a toolkit of finely grained general purpose
> tools, the better.
>
> Clearly there will be some things that don't fit this mold, and you'll
> just have to put the rules down in the stored procedures. So be it.
Thanks very much for your input! Would you agree then, that one cannot
always conform to the OCP. IOW some business rules should live in the
sps (although we don't like it) at some point down the road i might
need to change existing code even just to extend behavior?
- Next message: Michael N. Christoff: "Re: Mars Rover Controlled By Java"
- Previous message: Isaac Gouy: "Re: OOA?"
- In reply to: Robert C. Martin: "Re: Where do business rules belong... OCP and SPs"
- Next in thread: Rod Davison: "Re: Where do business rules belong... OCP and SPs"
- Reply: Rod Davison: "Re: Where do business rules belong... OCP and SPs"
- Reply: Robert C. Martin: "Re: Where do business rules belong... OCP and SPs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|