next up previous contents index
Next: Sending messages Up: Message Passing Pattern Previous: Components of a constructor   Contents   Index


Creating instances of a class

The diagram below illustrates what happens, when a constructor is invoked to create an instance of a class. The rectangles in the diagrams represent environment frames. Environment frames are linked with one another making up (together with the global environent) the total environment.

The label `$ <$environment 1$ >$' refers to the inherited environment and `$ <$environment 2$ >$' to the new environment frame created by the activation of a closure (call of a function). In our example `$ <$environment 2$ >$' has been created by calling the constructor `make-account'.

There are two closures of special interest in our example illustrated by the black bullets:

\includegraphics{img/objdemo2a.eps}

next up previous contents index
Next: Sending messages Up: Message Passing Pattern Previous: Components of a constructor   Contents   Index
domain access counter Georg P. Loczewski 2004-03-05