Some frameworks include a library of UI programming language classes similar to GUI framework libraries. With these, a web page can be composed using the programming language objects. Such a composition can then be rendered as markup.

This is called the component library approach (resorting under ProgrammingLanguageCentric strategies for generating dynamic pages).

As an example, here is a Java method returning a window (or page), using the Echo framework. (The example is a stripped-down adaptation of their own hello world example.)

   1 public Window init() {
   2 
   3     Window window = new Window();
   4 
   5     ContentPane content = new ContentPane();
   6     window.setContent(content);
   7 
   8     Label label = new Label("Hello, World!");
   9     content.add(label);
  10 
  11     return window;
  12 }

The returned Window object can then be rendered in HTML by calling a method on it.

ComponentLibraries (last edited 2006-01-26 14:22:40 by IwanVosloo)