FROM : Helge Hess
DATE : Mon Dec 02 03:27:01 2002
Philip Mötteli wrote:
>> It is not possible to know what methods can change instance variables.
>> Certainly not before they are called, anyway. Not at compile time, not
>> at run time.
> I thought so. I just wanted to be sure.
> In Java, one can do that with the aid of the preprocessor.
Well, you could write a preprocessor for ObjC too, but parsing ObjC is
much more difficult than parsing Java.
> I'm in the process of writing an Objective-C interface for an OODBMS.
> When a method will change an instance variable, we have to test, if that
> object is already locked and otherwise lock it and afterwards
> propagating the changements forward to the DB.
AFAIK Versant is doing this using the systems VM system. It
write-protects the memory page containing the object and intercepts
accesses. Of course this has several advantages and disadvantages (one
is, that you will probably need to lock all objects inside the page).
Another thing you could do is to return a proxy object from the DB
instead of the real one. In the proxy you can override
-forwardInvocation: and intercept all calls to the "real" object. Of
course you must ensure in your API that the user never sees the "real"
object (map between the two "object-spaces").
This is pretty similiar to the Java bridge and probably easy to
implement. Disadvantage: could become pretty slow though a lot of
optimization can be done.
Helge
--
__________________________________________________________________
Helge Hess Email: helge.<email_removed>
SKYRIX Software AG Tel: +49-391-6623-0
Universitaetsplatz 12 Fax: +49-391-6623-599
39104 Magdeburg, Germany Internet: http://www.skyrix.com
__________________________________________________________________
Upgrade your SLEMS 3.x: http://www.skyrix.de/de/news/
__________________________________________________________________
DATE : Mon Dec 02 03:27:01 2002
Philip Mötteli wrote:
>> It is not possible to know what methods can change instance variables.
>> Certainly not before they are called, anyway. Not at compile time, not
>> at run time.
> I thought so. I just wanted to be sure.
> In Java, one can do that with the aid of the preprocessor.
Well, you could write a preprocessor for ObjC too, but parsing ObjC is
much more difficult than parsing Java.
> I'm in the process of writing an Objective-C interface for an OODBMS.
> When a method will change an instance variable, we have to test, if that
> object is already locked and otherwise lock it and afterwards
> propagating the changements forward to the DB.
AFAIK Versant is doing this using the systems VM system. It
write-protects the memory page containing the object and intercepts
accesses. Of course this has several advantages and disadvantages (one
is, that you will probably need to lock all objects inside the page).
Another thing you could do is to return a proxy object from the DB
instead of the real one. In the proxy you can override
-forwardInvocation: and intercept all calls to the "real" object. Of
course you must ensure in your API that the user never sees the "real"
object (map between the two "object-spaces").
This is pretty similiar to the Java bridge and probably easy to
implement. Disadvantage: could become pretty slow though a lot of
optimization can be done.
Helge
--
__________________________________________________________________
Helge Hess Email: helge.<email_removed>
SKYRIX Software AG Tel: +49-391-6623-0
Universitaetsplatz 12 Fax: +49-391-6623-599
39104 Magdeburg, Germany Internet: http://www.skyrix.com
__________________________________________________________________
Upgrade your SLEMS 3.x: http://www.skyrix.de/de/news/
__________________________________________________________________
| Related mails | Author | Date |
|---|---|---|
| Philip Mötteli | Nov 28, 16:59 | |
| David Remahl | Nov 28, 17:41 | |
| Philip Mötteli | Nov 29, 00:32 | |
| Chris Hanson | Nov 29, 18:22 | |
| Helge Hess | Dec 2, 03:27 |






Cocoa mail archive

