Object identity changes while implementing restriction method?!
From: Julia (NoOne_at_Home.com)
Date: 04/30/04
- Next message: Ilja Preuß: "Re: Aggregation vs composition"
- Previous message: Ilja Preuß: "Re: Aggregation vs composition"
- Next in thread: svejk: "Re: Object identity changes while implementing restriction method?!"
- Reply: svejk: "Re: Object identity changes while implementing restriction method?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 13:11:44 +0200
Hi,
I am in process of writing an object model which being persisted into a
relational data base
and I want to add a RESTRICTION method which return a sub collection of
objects
for example,assuming I have the following table:
PERSONS
And the following class:
class Person
{
Public Property Get Parent() as Persons 'Weak reference to the parent
collection
}
And hopefully the ability to write something like this:
Dim Persons as Persons
Dim Childrens as Persons
Dim Person as Person
Set Persons=Application.Persons 'All persons
Set Childrens=Persons.Restrict("age<18") ' Subset of persons
as far as I understand,since the Person object support the 'Parent' property
it's identity
compose of a row identity and the 'context'(the parent) in which it was
created.
In such case I need to hold more that one object for the same row?!
What is the solution for such a problem?
Assuming I agree to hold several objects for a row, is it good idea to make
all in memory objects
(which represent the same row) up to date?
meaning if one object state is change should I change all other object state
as well?
In such way i can preserve the correctness of a row representation *
(if one object saved to a data base other will reflects the current row
state as well, without the need
of reloading the row)
While keeping the difference of the context(the parant) for each object.
Thanks,
* assuming no changes to fields made by external process(calculated,trigger
etc...)
- Next message: Ilja Preuß: "Re: Aggregation vs composition"
- Previous message: Ilja Preuß: "Re: Aggregation vs composition"
- Next in thread: svejk: "Re: Object identity changes while implementing restriction method?!"
- Reply: svejk: "Re: Object identity changes while implementing restriction method?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|