Re: Object-relational impedence

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Mon, 10 Mar 2008 19:53:34 -0300
Message-ID: <47d5bbf2$0$4032$9a566e8b_at_news.aliant.net>


TroyK wrote:

> On Mar 8, 7:09 am, rp..._at_pcwin518.campus.tue.nl (rpost) wrote:
> 

>>TroyK wrote:
>>
>>>Who said anything about stored procedures? I'm talking about
>>>implementing the business rules via constraint declaration in the
>>>database, and deriving new values throught the application of SQL
>>>queries.
>>
>>Do you also treat dynamic constraints in this way?
>>
>>E.g. "unless otherwise specified, an employee shall get a 2%
>>salary increase after each full year of employment".

with not_excluded_ee = (
  employees join ( employees{ee#} minus excluded_ees{ee#} ) ), increases = extend (

   not_excluded_ee where is_anniversary_period(pay_period(now),hire_date) ) add increase = salary * percent(2)
...

>>Or: "two movable 3D shapes shall never collide; collision is avoided
>>by the following repositioning algorithm that is guaranteed
>>to pull all objects apart that get too close: (...), however, this
>>algorithm may be replaced with another that has the same property".

with other_objects = objects rename all prepending "other_" , collisions = objects join other_objects

   where rank_attrib < other_rank_attrib      and min_distance(polygons,other_polygons) < threshold_distance , while exists(collisions) {

     update collisions
     set position = ...
     , other_position = ...

}

>>
>>--
>>Reinier

> 
> Inferring the definition of "dynamic constraint" from your examples,
> in the first, I think that it would be sufficient to model and record
> whatever attribute means "otherwise specified" and include that as
> part of the condition in the constraint declaration.

What was the constraint part again?

> I haven't had occasion to apply the technique to anything more complex
> than such an example, so I'll have to say "I don't know" to the 3D
> example.
> 
> TroyK
Received on Mon Mar 10 2008 - 23:53:34 CET

Original text of this message