Elan:
> > > 4. Should the object be serializable including hidden functions?
> > [I do not understand 'serializable' ?]
>
> By "serializable" I mean that: If I have the object (including its
> private components) loaded in memory, should I be able to write the
> object including its private components to a file? Or is it sufficient
> if I only write the public components of the object to a file? I.e.
>
> o: make object! [something: none]
>
> write %filename.ext mold o
[thanks, I didn't know this one. I used 'save to keep the object
structure intact...]
> will write this object to a file.
> If I add private components to this object, and I want to write the
> object to a file, should the private components be written along with
> the object? Or should the object be written without the private
> components, which means that when the object is subsequently loaded from
> this file, it will not include the private components.
[In the specific context of my try for OODBMS development, the
persistence of the DBobject should indeed request to be written down
INCLUDING the private methods, because those should contain some business
intelligence needed to access/handle the contained data]
> >
> > > 5. Should descendants have access to hidden functions?
> > [yes they should. Although it should be interressant to me to
> have a
> > mean to control this: some sort of 'protected function' which is known
> to
> > the ancestor, but not to the child objects...]
>
> Is this "protected" function in addition to the private function? If
> not, then I don't see how descendants can access the hidden function, if
> this hidden function is not known to descendants.
[you're right ! methods would be classified in three exclusives
classes: public, private and protected
Sample use of them could be:
- public access : the method can be called from any script in the
application.
- private access : the method can be called only from scripts in the
object for which the function was declared (including the sub-objects); the
method cannot be called from descendant of the object.
- protected access : the method can be called only from scripts for
the object for which the function was declared, and its descendant.
!!! ATTENTION !!! After studying some more documentation I
collected, I've noticed that I interverted the meaning of the concept
'private' and 'protected' : that's why the definitions above doesn't mach
anymore what I previously said. Sorry for the inconvenient. ]
> > That is, a private function is a function only known and
> accessible
> > from within the context of the object. A public one is part of the
> public
> > interface of the object and is therefore accessible from outside the
> object,
> > by another object from exemple]
>
> Basically, my question is, to what degree do you want to enforce this?
> Is it
> a) more an organizational principle to help you as a programmer organize
> your code;
> b) you don't want the private functions/words to show up in the block
> returned by first object, but if a non-member function absolutely wants
> to, then it will
> will be able to also access hidden words ...
> c) Under no circumstances must a non-member function be able to access
> private components?
[as I see the implementation for now, my meaning of it is to enforce
the protection of the object's contain by keeping the protected/private part
out-of-bound for the context from which the object is called. That is, using
your words, your point c).
Creating highly encapsulated objects organize for sure the code, but
more important allows you to completely control any modification and access
to properties and methods, which is important in the process of creating
waterproof applications...
]
> That's, basically what I'm asking
[I hope you'll find my answers satisfying.]
> Take Care,
[Thank you for caring ;-)) ]
> Elan
[
Best regards,
chr==
]
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.
[REBOL] Re: Private Object Function
CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN Tue, 16 Jan 2001 07:11:44 -0800
- [REBOL] Re: Private Object F... CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN
- [REBOL] Re: Private Obj... Elan
- [REBOL] Re: Private Obj... CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN
- [REBOL] Re: Private Obj... CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN
- [REBOL] unsubscribe Petter Egesund
- [REBOL] Re: Private Obj... CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN
- [REBOL] Re: Private Obj... CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN
- [REBOL] Re: Private... Andrew Martin
- [REBOL] Re: Private... Elan
- [REBOL] Re: Pri... Elan
- [REBOL] Re: Private Obj... CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN
