An extended discussion of extensibility
----boundary-LibPST-iamunique-619680857_-_-
Content-type: text/plain
Hello all participants,
having been off for a week I stumbled over all the interesting arguments
from various sides.
To take it short, I am in line with Rene's arguing. Handling encapsulation
only on the module level really seems to be a big step back to the times
of Modula-2. And then I don't believe a procedure call in the style of
Module.Init(o) to be the same as o.Init. The former allows any object of
the correct type as argument (and it might well be the wrong object)
whereas the latter initializes exactly the calling object and can't - by
mischief - touch any other. This is a different degree of safety, isn't
it? (see Rene's node example)
To me encapsulation on the module level really is an advantage of
modularized languages over class based languages but it primarily serves
as enclosure for data and actions with a high degree of interdependence so
they can be intimate, a feature for example Java doesn't offer (inner
classes don't do, they are a construct reminding me of the queer inner
modules in Modula-2).
Encapsulation on the level of classes is more and as Rene pointed out
allows independent development, you only have to know the immediate
superclass (and the exporting module of course) for your specialized class.
And this brings me back to the chain of modules A, B, C and their
respective classes inheriting one from another and it brings me back to
EXTENSIBLE procedures.
I guess we agree that - on the pure Component Pascal level - EXTENSIBLE
RECORDs are unneccesary. The question was whether EXTENSIBLE procedures
are neccessary. My arguments on Init procedures were based on the chain of
initializations each base type needs and I didn't see how to avoid super
calls in this case until ...
I confess, my ears blushed!
Marc, many thanks for your marvellous reminder of upcalls (yes, I knew
about them but simply didn't think of it). I believe you are quite right,
it is in the responsibility of the lowest base class to provide for the
Init2 procedure(s) needed by extending classes and it is really bad
programming to export the Init procedure as EXTENSIBLE as I did; instead
implement only export of an otherwise ABSTRACT procedure like in your
example is the way to go. I always felt unhappy with implementation
inheritance which is used when doing supercalls but, as I said, I didn't
see the way to avoid it until now.
So with this the argument for EXTENSIBLE procedures vanished and they are
a matter of personal style as were EXTENSIBLE RECORDs and Fjodor is right,
both might - on the level of Component Pascal at least - be banned.
A final question remains, mainly concerning Oberon Micro Systems. In
Marc's example PROCEDURE (b: B) Init2- is exported (implement only) again,
the compiler enforces this. Nevertheless it seems silly because on one
hand the export mark signals it as implement only and it actually is the
implementation, it can't be anything else. Thus I would prefer not to be
forced to export it again, I should prefer to keep it private, it
unnessecarily burdens the interface (yes, I know, I can attribute it as
EXTENSIBLE - there it is again: EXTENSIBLE - and then export it again with
all consequences, but I just want it private).
Regards
Harro von Lavergne
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-619680857_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhlbGxvIGFsbCBwYXJ0aWNpcGFudHMsXHBhcg0K
XHBhcg0KaGF2aW5nIGJlZW4gb2ZmIGZvciBhIHdlZWsgSSBzdHVtYmxlZCBvdmVyIGFsbCB0aGUg
aW50ZXJlc3RpbmcgYXJndW1lbnRzICBccGFyDQogZnJvbSB2YXJpb3VzIHNpZGVzLlxwYXINClxw
YXINClRvIHRha2UgaXQgc2hvcnQsIEkgYW0gaW4gbGluZSB3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lIHNhbWUgYWRkcmVz
cyBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQgdG8gdGhlIG1haWxpbmcgbGlzdC4gVGhhdCB3
YXksIHRoZSBsaXN0IHNlcnZlciB3aWxsIHJlY29nbml6ZSB5b3UgYXMgc3Vic2NyaWJlciBhbmQg
Zm9yd2FyZCB5b3VyIHBvc3RpbmcgaW1tZWRpYXRlbHksIHdpdGhvdXQgY3JlYXRpbmcgYW55IG92
ZXJoZWFkLlxwYXINClxwYXINCmIpIElmLCBmb3Igc29tZSByZWFzb24sIHlvdSBjYW5ub3QgcG9z
dCBmcm9tIHRoZSBhZGRyZXNzLCBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQsIHlvdXIgbWVz
c2FnZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBhdm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0
aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBjYXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFy
IG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheXN9fQBwNuNZIw=
----boundary-LibPST-iamunique-619680857_-_---
Received on Mon Oct 11 2004 - 12:56:43 UTC
This archive was generated by hypermail 2.3.0
: Thu Sep 26 2013 - 06:28:34 UTC