mardi 28 avril 2009

UI Model and separation of concern

While reading the excellent "Beautiful Architecture", I found the concepts used by LPS Creator Studio around UI and UI Model very interesting. So I started the implementation of a sample actionscript framework to validate my feelings about this architecture.
So far, I've created Properties (StringProperty, BooleanProperty, CommandProperty) and one form (RegistrationForm). I also started a RegistrationCanvas which represents the 'screen'part : pure UI, no behavior.

The UI elements on the screen are driven through binding to the form and its properties so the UI can stay 'dumb'.
The form gathers the properties and is in charge of the UI business logic : validation, flow, command launching.

I like the separation of concerns that this architecture brings and the fact that it will allow to write unit tests easily for the UI model.