JANFROG:
Kdyz uz jsme u tech zavadejicich vyroku:
napriklad (muj oblibeny a v mnoha smerech prukopnicky :-) Self ma pouze delegovani a jen velmi tezko lze zpochybnit, ze to je OO jazyk.
Ehm, otevrel jsem si dokument Self Power of Simplicity z roku 1987 a cituji:
In SELF too, everything is an object. But, instead
of a class pointer, a SELF object contains named slots which may store either state
or behavior. If an object receives a message and it has no matching slot, the search
continues via a parent pointer. This is how SELF implements inheritance. Inheritance
in SELF allows objects to share behavior, which in turn allows the
programmer to alter the behavior of many objects with a single change.
Prototypes combine inheritance and instantiation to provide a framework that is simpler and more flexible than most object-oriented languages. Slots unite variables and procedures into a single construct. This permits the inheritance hierarchy to take over the function of lexical scoping in conventional languages.
Nebo handbook k poslednimu releasu:
Parent slots can be omitted from an object’s full
name, since the slots in a parent are visible in the child via inheritance.
Nebo z paperu "Inheritance and encapsulation in SELF":
We believe there are two reasons to include inheritance in a dynamically typed language like SELF: malleability a reusability. Inheritance allows the behaviour common to set of objects to be factored into a single shared object...
Inheritance encourages the reuse of code and data by allowing the programmer to write new abstractions in terms of existing abstractions. Programmers need only write the differences from existing code when defining new abstractions, the rest of the code may be shared among the old abstraction and
the new abstraction. Improvements to one abstraction automatically propagate to every abstraction that shares the behaviour, further amplifying programmers power.
Lepe bych to nenapsal aneb krasna definice dedicnosti jakozto principu.
The common theme in malleability and reusability is sharing: one object is
shared by other objects, promoting malleability and providing for reusability.
Inheritance is just a declarative way of specifying which objects are shared by
which other objects. One guiding principle of our design for inheritance in SELF,
then, is that an object’s parents are treated as shared subparts of the object.
atd. atd.
Jiny typ dedicnosti, stale vsak dedicnost - to ze se misto volani metod/funkci nebo pristupu k atributum/fieldum parent tridy deleguje zprava parent objektu + to ze jde sdilet parent sloty je jen odlisnost v implementaci dedicnosti. Uz jen to, jak casto se pouziva v te specifikaci slovo parent na vysvetleni parent-child vztahu je dost vymluvne... Kdyz se vratim k pozadavku dedicnosti jako zakladnimu kriteriu OOP, tak plati dokonce i pro prukopniky/exoty jako Self, jako bonus k tomu maji stejny nazor na zakladni principy OOP prekvapive i autori ucebnic OOP programovani, nastesti v tom nejsem sam :-)
Ze se v nasi pri na jedne strane objevil jako podpurny argument umirajici, archaicky a temer nepouzivany jazyk s nejakou roli v historii garbage collectoru a JITu a nulovou roli v soucasnosti je vec druha. A ano, existuji i objektove jazyky, kde nejsou atributy a pouziva je mene nez 1% programatoru. Muzeme je tedy s klidem nazvat mrtvou/slepou vyvojovou vetvi, za 20 let o nich mozna ? bude jednoradkova zminka na wikipedii - historii pisi vitezove ;-)