Self




       ”More Smalltalk than Smalltalk”




  Michal P´se (CTU in Prague)
          ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   2/7
Self




       ”More Smalltalk than Smalltalk”
       Goal: to simplify the language as much as possible




  Michal P´se (CTU in Prague)
          ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   2/7
Results




     Fields and methods are slots




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   3/7
Results




     Fields and methods are slots
     No classes, only cloning and modification




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   3/7
Results




     Fields and methods are slots
     No classes, only cloning and modification
     Dynamic inheritance




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   3/7
Dynamic Inheritance




     Some slots may be marked parent slots.
     Lookup algorithm traverses these slots.
     Even when invoking a method found in a different object, the receiver
     does not change.




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   4/7
The Little Differences




See the following patterns: singleton, proxy, chain of responsibility, state
and strategy.




  Michal P´se (CTU in Prague)
          ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   5/7
Let’s Look at Dynamic Inheritance Once More




     How is it different from composition?




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   6/7
Let’s Look at Dynamic Inheritance Once More




     How is it different from composition?
     How is it different from ”static” inheritance?




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   6/7
Let’s Look at Dynamic Inheritance Once More




     How is it different from composition?
     How is it different from ”static” inheritance?
     Perhaps there exists a concept generalizing both?




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   6/7
See




James Noble and Brian Foote. Attack of the clones. In Proceedings of
the 2002 conference on Pattern languages of programs - Volume 13
(CRPIT ’02) (2002), 99–114.




 Michal P´se (CTU in Prague)
         ıˇ                    Object Programming Lect. 13: Prototype Languages   December 21, 2010   7/7

Prototype Languages

  • 2.
    Self ”More Smalltalk than Smalltalk” Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 2/7
  • 3.
    Self ”More Smalltalk than Smalltalk” Goal: to simplify the language as much as possible Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 2/7
  • 4.
    Results Fields and methods are slots Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 3/7
  • 5.
    Results Fields and methods are slots No classes, only cloning and modification Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 3/7
  • 6.
    Results Fields and methods are slots No classes, only cloning and modification Dynamic inheritance Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 3/7
  • 7.
    Dynamic Inheritance Some slots may be marked parent slots. Lookup algorithm traverses these slots. Even when invoking a method found in a different object, the receiver does not change. Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 4/7
  • 8.
    The Little Differences Seethe following patterns: singleton, proxy, chain of responsibility, state and strategy. Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 5/7
  • 9.
    Let’s Look atDynamic Inheritance Once More How is it different from composition? Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 6/7
  • 10.
    Let’s Look atDynamic Inheritance Once More How is it different from composition? How is it different from ”static” inheritance? Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 6/7
  • 11.
    Let’s Look atDynamic Inheritance Once More How is it different from composition? How is it different from ”static” inheritance? Perhaps there exists a concept generalizing both? Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 6/7
  • 12.
    See James Noble andBrian Foote. Attack of the clones. In Proceedings of the 2002 conference on Pattern languages of programs - Volume 13 (CRPIT ’02) (2002), 99–114. Michal P´se (CTU in Prague) ıˇ Object Programming Lect. 13: Prototype Languages December 21, 2010 7/7