borland.public.delphi.oodesign
Date: 25 May 2003 17:00:50 -0700
Message-ID: <e4330f45.0305251600.5d89799a_at_posting.google.com>
If someone wants to see something about the state of the data management theory knowledge in the OO coders community you might be interested in taking a look at this group.
Perhaps you will be as amazed as I was.
For instance:
update employees set salary = salary * 1.05 where (country = 'Spain' or country = 'Brazil') and hiredate < ToDate('1/1/2003');
Is a very bad approach because it is not encapsulated, and you must do things like this in your application code:
equal1 := EqualToCriteria.Create('country', 'Spain'); equal2 := EqualToCriteria.Create('country', 'Brazil');
equal1.AddOrCriteria(equal2);
lessthan := LessThanCriteria.Create('hiredate', '1/1/2003');
updateCriteria.ForClass('Employee');
updateCriteria.AddAttribute(salary, salary * 1.05);
updateCriteria.AddSelectEqualTo(equal1); updateCriteria.AddSelectLessThan(lessthan);
updateCriteria.Perform;
But if you are depressed don't look at this group :-)
The really sad thing is that a lot of newcomers are "learning" the "new" approach on that group.
Regards
Alfredo
Received on Mon May 26 2003 - 02:00:50 CEST
