The seaBreeze Application Model

Overview

The SBApplicationModel class is the superclass of all application models in seaBreeze. For each component that's created for an application, a subclass is created.

The user interface of an application model is stored in a class-side method called #windowSpec. Each #windowSpec stores a serialized instance of the application model in SLAR (Simple Literal Array Representation) format. This format is a generic way of converting an object hierarchy into a literal array and back.

When the application model is instantiated the #windowSpec is deserialized and the elements created and linked to the application model's aspects. Aspects are value models that are stored in the application model. If for instance an application model has an input field linked to an aspect called #name, then the application model has to have a method called #name that returns a value model on a string that is edited by the input field. Typically these are instances of ValueHolder storing a string. If the application model is a user interface for a domain object, the aspects can of cause also be AspectAdaptors or other subclasses of ValueModel.

 

Editing the User Interface of an Application Model

The user interface of an application model is modified in the WebPainter. To open the editor from the seaBreeze application, click on the Editor button in the toolbar at the bottom. In the seaBreeze Browser there is an edit button next to each application.

 

The Start-Up of a seaBreeze Application

If you open a seaBreeze application in a web browser, an instance of the application's application model will be created and initialized. There are three methods which are called during the build phase of the application instance. The default implementation of these methods will do nothing. All three are called with a builder object as the argument, which provides access to the elements on the page in different stages of the build process.

  • preBuildWith:

    • this method is called before the elements for the web page are created, the builder did not read the #windowSpec yet.

  • postBuildWith:

    • the builder just finished building the windowSpec, thus it knows all the elements on the web page.

    • the elements have not been rendered yet

    • to access an element, just use the dictionary returned by the builder's #namedComponents method. The keys in this dictionary are the IDs of the elements.

  • postOpenWith:

    • this method is just called for compatibility reasons with VisualWorks' default behavior. It is called right after #postBuildWith: and the application has not been rendered yet.

 

Copyright 2013 by Georg Heeg eK, released under MIT License