In early April, 2010 the Fiz team discussed the status of the project and evaluated our success so far in trying to create a component framework for Web applications. The participants in the discussion were Katsushi Fukui, Sameer Madan, John Ousterhout, and Eric Stratmann. This page contains a summary of our conclusions. Here is a short executive summary:

Project Status

Things that appear to be working

Sections

The basic mechanism of dividing a page up into Sections seems to be working pretty well. There isn't a lot of functionality in this mechanism, but it seems to provide a pretty good framework for hiding details such as HTML complexities, CSS, and Javascript-driven components.
We've been able to build several sections that encapsulate interesting functionality, such as FormSection, TreeSection, and ChartSection.

Forms

The form mechanism appears to be working quite well. We have been able to implement a number of nice features as part of the form mechanism, such as:

Fiz forms do a pretty good job of hiding the complex interactions between all of these features; they are reasonably easy to use for simple things, and can be customized to do fancier things. In general, forms seem to be a good match to a framework based on components.

Ajax support

We built Fiz under the assumption that Ajax would be used extensively in Web pages, so Fiz contains several facilities that make it relatively easy to use Ajax:

Buffered page rendering

In Fiz the HTML output for a page is not flushed to the browser immediately. Instead it is buffered in memory on the server until the page is complete. The contents of the page are collected in several different categories (header, Javascript, HTML), which means that additional header content can be created at any point during the page generation process. This makes it easier to create components, since any individual component may need to add content to the page header. Without buffering, the page header will have been flushed by the time the first component is rendered, making it impossible for later components to add to the header.

Things that aren't working very well

Data managers

The greatest weakness of the current Fiz implementation is probably the data manager mechanism, which is used for managing back-end data. Right now data managers provide a very thin abstraction; they are simply classes that move information between Datasets and back-end storage. We have built a few simple data managers for accessing files, SQL data, and the AppEngine Datastore, but these don't provide much more than a thin wrapper around the underlying storage systems. They don't appear to be particularly easy to use. We have used the existing data managers for a few simple applications, but we suspect they would be difficult to use for more complex things.

We are not yet sure what is the right solution to this problem, but here are few miscellaneous thoughts:

In the original version of Fiz we used an asynchronous approach to data management along with a 2-pass mechanism for page rendering. Each page was rendered by making 2 passes over all of its components. In the first pass, each component could initiate one or more data requests from data managers (without waiting for any of them to complete). In the second pass, each component rendered its portion of the final page, waiting if necessary for its data requests to complete. This approach was chosen in order to allow more efficient handling of data requests, e.g. by executing requests concurrently and/or batching requests for the same data manager.

However, in practice we found that this was not a convenient style for application developers. They had trouble "getting" the 2 pass approach and tended not to use it in the right way; typically they would render one component at a time, invoking each component twice in a row, once to initiate its data requests and once to render the component. This made the application more complicated and limited the benefits of the asynchronous approach to data management. In addition, there are many situations where the data requests cannot be executed in parallel, since some requests depend on the results of others. We eventually decided that the performance benefits of the asynchronous approach were dubious, while the complexity disadvantages were quite clear, so we switched to a simpler single-pass approach without asynchronous data requests. (However, with the new lazy dataset mechanism it will become possible to implement asynchronous requests again, for applications that want them.)

Maybe templates are a good idea after all

One of the original hypotheses for Fiz was that templates are a bad idea: they encourage developers to work at too low a level (HTML) and the mixture of code and HTML doesn't scale very well (there ends up being too much code to understand the HTML and too much HTML to understand the code); we thought that templates would interfere with the development and use of components.

However, we are gradually coming to appreciate the benefits of templates. We ended up implementing a simple template package fairly early in the Fiz development, intended primarily for use by component developers. Over time we have been gradually adding to the template mechanism; developers seem to use it quite a bit when generating any real pages. Here are some examples of why templates are still useful, even in a world where we are trying to encourage people to use higher-level components as much as possible:

As a result we are gradually rethinking the role of templates in Fiz. One example is a new general-purpose Layout mechanism that uses a template-like approach to separate layout and content. We are also considering ways of making the existing template mechanism more general and powerful; it's clunkier to use templates in Fiz than in other frameworks such as Rails or Django.

We are still concerned that templates are not the right mechanism to use for creating reusable components, but they do seem to serve an important role for smaller non-reusable parts of applications.

Customization

In order for components to be used successfully they must be easy to customize; otherwise developers will be forced to abandon the components and build new ones if they need features not currently supported. We have tried to make the Fiz components as customizable as possible, but we aren't yet sure that they are customizable enough. Also, the customization mechanisms add complexity to the components, which makes them harder to use; there appears to be a trade-off between ease of use and customizability.

Simple sites are too hard

It still feels too hard to build simple Web sites with Fiz: there is too much to learn, too much stuff has to be set up, and Fiz does not provide much structure for how to organize a Web site. If we don't make it easier to build simple sites, people may never get to the point of appreciating Fiz's benefits for larger sites.

Datasets

Fiz contains a mechanism called Datasets, which is a general-purpose facility for passing around structured data. Datasets are something like a combination of arrays and hashes in languages such as Javascript, and they integrate cleanly with the Fiz template mechanism. Initially there was some concern that datasets are too thin and abstraction to be interesting: are they just a compensation for the lack of good arrays and hashes in the Java language? This may still be true, but we have been gradually adding more and more features to Datasets, which are making them more interesting:

The weak typing is one of the biggest advantages of datasets (it makes them more flexible than Java HashMaps, for example), but it can also be a disadvantage since certain kinds of errors cannot be detected at compile time.

Overall, we're feeling more and more like Datasets provide interesting and useful containers for data in Web applications.

Java

The choice of Java as implementation language for Fiz was an experiment that John Ousterhouts decided to try at the beginning of the project. Most modern frameworks are implemented in scripting languages, and John wanted to see how well a more strongly typed language might work in this context. There were two primary motivations for choosing Java:

On the other hand, strongly typed languages are notorious for being verbose and inflexible; one of the goals for Fiz was to see if we can compensate enough for the potential disadvantages of a strongly typed language to make it a viable platform for modern Web framework.

Although the experience with Java has not been horrible, our conclusion is that we would probably have been better off using a more scripting-oriented language. Here are some comments on our Java experiences:

Next steps and future projects:

Here are a few ideas we discussed for things to do next in the Fiz project: