Skip to content

Documentation

arigesher edited this page Oct 28, 2011 · 17 revisions

Cinch Documentation

Definitions

There are several interpretations of Model-View-Controller so we'll provide ours up front:

Model

A Model is a class that implements BindableModel and provides getters and setters for JavaBeans-style named properties. A Model does not directly have knowledge of any Views or Controllers. Generally the code in the Model is not very complicated and only serves to keep the model data in a valid state. It indirectly may refer to these through a list of listeners.

View

A View is any class that holds a reference to a Model and depicts it in some way, shape, or form. Within the scope of this framework there is no need for a View to be tied to Swing or any other UI framework. A View has direct knowledge (i.e., a reference) to some number of Models and Controllers.

Controller

A Controller is a class that incorporates "business logic" or any large block of code that processes the data in a Model. The logic in the Controller can be arbitrarily complex. Typically the controller will take some number of Models as input, process some logic, and set values on the various models. Controllers only have direct knowledge (i.e., a reference) to Models or Controllers.

Next Steps

Technical Guide

Name Disambiguation

As your Views get more complicated it's possible that you'd have multiple models of the same type in a single view or controllers with similarly named functions. Since the names of bound methods are specified by string there is potential for ambiguity in these cases. To get around this the Bound.to and Action.call (and other) string definitions support disambiguation. The rules are as follows:

  1. If the string uniquely identifies a model property or bindable method then there is no problem.
  2. If there are two or more possibilities then you must specify the field name in the string like "model1.state" or "fileController.close".
  3. You can always use the long form in (2) even if the short form would suffice.

Compile Time Types versus Run Time Types

TODO

Performance

TODO

Costs

TODO

Threading

TODO

Future Work

SWT?

Clone this wiki locally