Examples written in Squeak/DCI

Note: The FullOO.info site is being restructured. All URLs are, therefore, likely to change.

BabyIDE is an experimental interactive development environment that supports the DCI paradigm with specialized browsers for its different perspectives. The IDE is described in section 3 in The Common Sense of Object Oriented Programming.

A ZIP file containing all you need for running Squeak/DCI in Windows XP can be downloaded from BabyIDE.ZIP. See its README file for more details.For other operating systems, you need to install Squeak on your computer. Go to http://www-1.squeak.org/ for details. The above ZIP file contains the .image and .changes files you need to browse the code and run the examples.

The source code for six Squeak/DCI examples has been filed out as .HTML files for your convenience.

The code may look unreadable to a reader more used to a mainstream language such as Java or C#. The main stumbling block is the syntax for message passing.The mainstream syntax is

receiver.selector (arg1, arg2, ...)
e.g., fileDirectory.copy (file1, file2);

The Smalltalk (and Squeak) syntax is different

receiver arg1Name: arg1 arg2Name: arg2.
e.g., fileDirectory copyFrom: file1 to: file2.

Internally, the Squeak compiler immediately transforms the above syntax to the mainstream form:

receiver arg1name:arg2Name (arg1, arg2).
E.g., fileDirectory copyFrom:to: (file1, file2)

This works because the colon (:) is a legal character in a message selector. It follows that the number of colons in a selector equals the number of arguments.

More about the Squeak language can be found at http://wiki.squeak.org/squeak/1859.

The Squeak/DCI examples are as follows:

BB2Shapes - An animation of a universe of interacting objects

BB3Greed - A clumsy implementation of the game of Greed.

BB4Plan - A rudimentary program for activity network planning.
Two versions: BB4aPlan is implemented without DCI. BB4bPlan implemented with DCI.
The example illustrates one way of using DCI to support MVC.

BB5Bank - The well known Bank transfer example
Illustrates A simple Context with two interacting Roles.

BB6PayBills - Uses the above to pay a list of bills.
Illustrates that a Context can be instantiated and triggered from a RoleMethod.

BB7Dijkstra - Implements a restricted form of the Dijkstra algorithm for finding the shortest route through a graph.
Illustrates recursion and different Roles being bound to the same object at the same time. Builds on Jim Coplien's implementation of the same algorithm.

BB1IDE is a listing of the BabyIDE code. Still in the 'make it work' stage. No DCI here, just spaghetti and noodles. Included for the enjoyment of the specially interested nerds.

More examples may be added later.