-
Notifications
You must be signed in to change notification settings - Fork 16
Documentation
There are several interpretations of Model-View-Controller so we'll provide ours up front:
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.
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.
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.
- Tutorial & Examples - a tour through a set of runnable examples that explain using the framework.
- More Examples - a list of examples included in the Cinch source tree.
- Annotations Reference - quick reference and links into the Javadoc for the Cinch framework.
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:
- If the string uniquely identifies a model property or bindable method then there is no problem.
- If there are two or more possibilities then you must specify the field name in the string like "model1.state" or "fileController.close".
- You can always use the long form in (2) even if the short form would suffice.
TODO
TODO
TODO
TODO
SWT?