Re: Business-logic in 3-tier architecture

From: David Cressey <david_at_dcressey.com>
Date: Sat, 26 Oct 2002 11:20:52 GMT
Message-ID: <oUuu9.211$0I3.19583_at_petpeeve.ziplink.net>


> Would'nt it be nice if the constraint for a column, once
> defined in the database would somehow automatically
> migrate itself into the client, so the constraint could be
> enforced immediately and automatically after the user has entered the
> value in the user interface?

There are some errors that ought to be caught at the client end. Things like alphabetic characters in a numeric field come to mind. Valid foreign keys is another matter. In some cases, replicating the validation table over at the client and validating right away might work, when the number of valid codes is small and stable. But things like validating a confirmation number by looking it up in the database are still going to be best done close to the data, not close to the screen.

Having said that, I share your wish, only slightly differently: Wouldn't it be nice if the constraints (rules, if you will) could be expressed in a conceptual model of the enterprise, extracted when needed to a model of the application and from there replicated to the database, and also to the client software, and have constraints enforced where it makes the most sense (perhaps in more than one place)? Received on Sat Oct 26 2002 - 13:20:52 CEST

Original text of this message