prototype languages

12

Upload: michal-pise

Post on 20-Jun-2015

691 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Prototype Languages
Page 2: Prototype Languages

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

Page 3: Prototype Languages

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

Page 4: Prototype Languages

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

Page 5: Prototype Languages

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

Page 6: Prototype Languages

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

Page 7: Prototype Languages

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 receiverdoes not change.

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

Page 8: Prototype Languages

The Little Differences

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

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

Page 9: Prototype Languages

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

Page 10: Prototype Languages

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

Page 11: Prototype Languages

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

Page 12: Prototype Languages

See

James Noble and Brian Foote. Attack of the clones. In Proceedings ofthe 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