Newsgroups: comp.lang.smalltalk,comp.org.acm,comp.software-eng,comp.object,comp.databases.object
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!ix.netcom.com!netcom.com!nntpuser
From: scottw@advsysres.com   (Scott A. Whitmire)
Subject: Re: Wanted: business rule ideas
Message-ID: <nntpuserDM335y.LIE@netcom.com>
Sender: netnews@mork.netcom.com
Nntp-Posting-Host: advsysres.com
Reply-To: scottw@advsysres.com (Scott A. Whitmire)
Organization: Advanced Systems Research
X-Newsreader: IBM NewsReader/2 v1.2
References: <4eldmi$2lf@news.inc.net>
Date: Thu, 1 Feb 1996 06:25:09 GMT
Lines: 36
Xref: glinda.oz.cs.cmu.edu comp.lang.smalltalk:34266 comp.org.acm:4285 comp.software-eng:41686 comp.object:44240 comp.databases.object:8985

In <4eldmi$2lf@news.inc.net>, Karen Jacqmin-Adams <kadams@froglit.scitele.com> writes:
>Hoping you can share:  I want some way of implementing business 
>rules as objects, for flexibility and reuse.
>
>Any ideas appreciated.
>

How you implement a business rule really depends on the type of rule it is.
Some rules control processes, that is, they control what happens to a set of
objects, and how those actions are ordered. Rules such as these become objects
which act upon objects in the data model. For example, if you have a set of
transactions that operate on a set of objects, such as receiving parts into 
drawing parts out of a store, you could create a Receive object and a Draw
object which performs the respective operations on the Part and Store 
objects. This way, if the Draw process changes, then only the Draw object needs
to be changed.

Other rules control the conversion of one kind of object into another kind of
object. These rules can be implemented as objects with a Convert method which
takes the source object as a parameter and returns a target object as a result.
This way, the same conversion object can be used on many pairs of source/target
objects.

For each rule you want to make into an object, look at how it operates on the
objects in the data model. When you understand that, then you will see how to
implement it as an object. Also, there are several design patterns in the Gamma,
Helm, Johnson, and Vlissides book ("Design Patterns") that deal with this sort of
problem. Take a look at that book and try to match the business rule to a pattern.

Scott A. Whitmire             scottw@advsysres.com
Advanced Systems Research     
25238 127th Avenue SE         tel:(206)631-7868
Kent Washington 98031         fax:(206)630-2238

Consultants in object-oriented development and software metrics.

