in reply to Difficulty with Object::InsideOut
However, taking a look at Object::InsideOut's documentation I noticed this:
Object::InsideOut implements inside-out objects as anonymous scalar references that are blessed into a class with the scalar containing the ID for the object ...
The underlined part implies that an object must access its body (the scalar ref) to get its id. This is something a real inside-out object never does. The salient point about the inside-out model is that nothing is stored in the object itself, so that the body is never accessed. This, and only this, gives inside-out classes the indepencence from object implementation that makes inheritance "just work", the way it does in dedicated OO languages.
In other words, Object::InsideOut doesn't give you true inside-out objects. You're probably better off if you base your class on one of the other implementations of inside-out classes on CPAN (Class::InsideOut or Class::Std), or implement it directly.
Anno
Update:I erroneously accused Class::InsideOut of not giving you "true inside-out objects". Corrected to say Object::InsideOut. Class::InsideOut does produce true inside-out objects. Apologies to those involved, and thanks to shmem who caught the error.
Update: Made links of some references to classes
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Difficulty with Object::InsideOut
by herveus (Prior) on Mar 24, 2007 at 17:44 UTC | |
by Anno (Deacon) on Mar 25, 2007 at 01:52 UTC | |
by herveus (Prior) on Mar 25, 2007 at 16:20 UTC | |
by Anno (Deacon) on Mar 25, 2007 at 20:52 UTC |