| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: The Myth of relational algebra (was Re: Clean Object Class Design -- What is it?)
Hi Vadim:
Sorry, I couldn't resist. Code from a system in GemStone/S a Smalltalk OODBMS. This code conforms closely to an in production object model
a Party has a collection of roles. The roles we need are the employeeRole and managerRole. Suffice it to say we have an EmployeeCollection. The EmployeeCollection implements the message managers, the manager implements directReports and the employeeRole implements salary. Employees and managers are Party objects with the appropriate Role object(s).
^EmployeeCollection soleInstance managers select: [ :eachManager |
(eachManager directReports
inject: 0 into: [:sum :eachEmployee |
eachEmployee employeeRole salary + sum])
> eachManager employeeRole salary]
A fairly typical OODBMS solution to the problem using a Smalltalk OODBMS.
Cheers!
Vadim Tropashko wrote:
> In article <9na529$6u5$1_at_wrath.news.nacamar.de>, Adrian Veith says...
> > Thre is a famous example for you to crack: find all managers who earn more > than sum of their employees. >
> > Not quite: materialized views work much the same way as indexes with query > rewrite. They allow to speed up complex queries with joins and aggregates. > How can you leverage materialized view technique in OODB without > relational closure?
-- Thanks!! Joseph Bacanskas [|] --- I use Smalltalk. My amp goes to eleven.Received on Fri Sep 07 2001 - 12:05:32 CDT
![]() |
![]() |