=== Top of the Swiki === Attachments ===

Fabrik

What is Fabrik

To quote from the original Fabrik paper [1],

Fabrik in Squeak

Fabrik with wires allows one to assemble UI widgets and comuptational components into useful applications without the need for written programs. An application may be used while it is being assembled, and it may be shipped as soon as assembly is complete.

The goal of the Squeak Fabrik project is to construct a system similar in operation to the original Fabrik, but simplified in two respects: leverage off Morphic (the original Fabrik used a complex MVC/Mac Toolbox hybrid), and use simple structural propagation in place of compiled dataflow (Squeak's speed is adequate for most applications that would be built in Fabrik, and compilation could always be offered as a later capability).

Wireless Fabrik

We want to experiment with a wireless interface where connections are made through the more conventional model of linked expressions in a spreadsheet. Wireless Fabrik is a UI builder just like Fabrik, but you type little methods in more of a spreadsheet manner, rather than wiring up existing components in a typical Fabrik diagram. Two plusses of the spreadsheet approach are that it doesn't have wires (some people don't like them), and that the methods look like real ST methods (with the model var names) rather than functions, so it's a bit easier to identify it with normal Squeak programming. The downsides are that it doesn't have wires (some people like them ;-), and that expressions do not capture bidirectional relationships as well as wires.

The synergy we're looking for in wireless Fabrik is that people can start out with a UI builder, and just type little Squeak expressions in a control panel. They will be learning expression syntax, but won't have to do "real programming" yet. The topological sort will take care of triggering the methods appropriately whenever something changes.

Current Status

The current Squeak release contains the sketch of a Fabrik implementation. Two classes, ComponentLikeModel and PinMorph provide most of the glue, and five other classes comprise the user library:


How to play with it

To build something from scratch, open a new ComponentLayout. If you drop three text components in, and wire them together (use shift-click on a pin to draw out a wire), POOF, you have a tri-directional 'Hello World' example. Type in any one of the textComponents, and type cmd-s for accept.

It should be possible to recreate the Browser example of PWM6 from scratch, but note that the top-left component is a printComponent. Also, as Rick Thomas says, "you did a good job of hiding the 'add pin' option for functioncomponents. It is on the halo menu alright but not reachable from the submorph option in the menu from a control click on the functionComponent."

Important Note
Please note that there are some code rot problems with Fabrik in 2.7. Most of these were fixed in update #1855, so try to use 2.8a or at least fileIn #1855 if you want to play with it.

Next Steps

Underlying Object Model

The first step in going forward is to formalize the underlying object model. Where are values, procedures, and other linkages stored in a Fabrik module.

Wired and Wireless Presentation

Specify the correspondence between the wiring and spreadsheet presentations and the corresponding alternate user gestures.

Integrate with Morphic UI

Provide a UserFrame object and integrate with Morhpic's SystemWindow. This will enable Fabrik to function as a UI Builder for Squeak.

Topological Sort

The toy implementation of Fabrik uses the MVC dependence mechanism for change propagation and it does not support bidirectional behavior in general. Topological sorting allows the logic of propagation to be computed once at edit time instead of constantly during execution.

Gateways and Encapsulation

Gateways (pin declarations) are needed to make Fabrik complete. The simple set of (input, output, inputOutput) are adequate to build Fabrik's entire library.

Iterators

Iteration through structures is achieved in Fabrik with evaluation frames and a library of special gateways. An evaluation frame is a rectangluar scope analogous to a block in Squeak. It allows for processing multiple sub-elements without needing to introduce time into Fabrik's timeless dataflow diagrams. The many useful variants of structural interation are achieved by introducing appropriate (initialization, streaming, terminating, etc) gateways on an evaluation frame.

Widget Library

A widget library is the key to a successful UI builder. Much can be done with just a few more components, but much more can be done with serious attention to this area. The ability to compose properties will be important to achieve generality without an overwhelmingly large library.

Primitive Widgets

A project that I think would be fun (whether for now or later), and that is separable from the kernel work, is to think about how to build up a widget library from scratch in Fabrik. Imagine, for instance, a mouseSensor morph that doesn't really have any appearance other than a default rectangle. But it's a Fabrik component that emits a boolean value (and induces a model slot for that output). Now we allow mixing, so that if you imbed this in any other morph (or vice-versa?), then you end up with something that looks like the other morph, but works like a button. Et cetera. I haven't quite reconciled this with the widget construction i did in the original Fabrik. By the way, if you don't know Fabrik well, then understanding how the Fabrik slider works is a good challenge. It's an interesting dataflow topology, and it really illustrates how the Fabrik graphics model works.

Simple examples

We already have the multidirectional 'Hello World' and the browser example. A next simple example in the direction of effects and widgets would be a font editor. A next example in the direction of Fabrik's charter in Squeak would be the browser done as a wireless construction.

Looking a little ways down the road, it will be interesting to work a few examples of "scratch programming" done in wireless Fabrik. These can then be compared with similar examples in other frameworks.

Another important link to make with life-as-we-know-it is to work an Etoy example such as Drive-a-Car in Fabrik.

Some Fabrik History

... can be found at Fabrik History

Were can I find more info on Fabrik?

[1] Dan Ingalls, Scott Wallace, Yu-Ying Chow, Frank Ludolph, Ken Doyle:
"Fabrik - A Visual Programming Environment"
in OOPSLA 1988 Proceedings, ACM SIGPLAN series.

This is accessible on the web, thanks to the efforts of Dwight Hughes.
http://users.ipa.net/~dwighth/smalltalk/Fabrik/Fabrik.html

[2] Frank Ludolph, Yu-Ying Chow, Dan Ingalls, Scott Wallace, Ken Doyle:
"The Fabrik Programming Environment"
Proceedings of the IEEE Workshop on Visual Languages 1988,
also reprinted in:
Ephraim P. Glinert (ed.):
"Visual Programming Environments - Paradigms and Systems"
[IEEE Comp. Soc. Press, ISBN 0-8186-8973-0]; (out of print)

The Glinert book is out of print, but with a bit of luck you'll find a used copy at Powell's or B&N. Make sure you get the right one, there's another volume with a similar title - I forget which, but not "Paradigms & Systems".

Back to Squeak Central Project List