Prototype Languages

Preview:

Citation preview

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

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

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

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

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 receiverdoes 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, stateand 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?

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

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

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 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

Recommended