|
|
Flest Framework
Flest is an ActionScript3 / Flex application framework for building enterprise level RIAs. It uses such design pattern as Controller, Factory, Command, etc. High efficiency, simplicity and practicality were set as its mandatory design features.
Although the framework operates with such class roles as Model, Controller, Command and view State, at current stage it is not considered an MVC implementation due to the following reasons:
- Technically Flex/AS3 RIA is a single-tier application that works as a front-end for whatever sits on the server side (dotNET, J2EE, PHP, etc). De-coupling RIA View from RIA Model does not seem practical in most cases because:
- RIA View and RIA Data Model are tightly coupled, for example, visible/selected/etc RIA View fields are possible statuses of various RIA Data Model elements, and
- RIA Data Model elements do not match one-to-one to Server Data Model elements, for example, on the server side such fields as visible/selected/etc would be an obvious overhead.
2. In Flest framework a Command is represented by a closure (a function that can run in a context of a given object). Some developers started keeping references to such Commands in Flest/RIA Data Model and found it very handy. This practice does not correspond to the MVC best practices and departs this framework even further from such paradigm.
Flest Framework has the following features:
- Flest Command class implements org.flest.command.ICommand interface and it can have as many functions as required. Each function may have as many parameters as required and returns back a reference of any required type.
- At runtime, a command function can be considered as an application command (or an action) that provides a limited logical functionality. For example, it could be something like retrieveDataFromBackend, validateUserCredentials, calculateTotal, sortCatalogue, etc.
- A command function is a closure, it runs by FlestController and therefore it is able to access any of FlestController's local fields, like the application itself (app is a local field of FlestController).
- FlestController deals with Errors thrown by the commands it runs. So there is no need of taking care of any Errors at command level.
- org.flest.factory.CmdFactory provides a reference to a Flest command ensuring that every command instance is a singleton.
- org.flest.model.ModelLocator provides an access to a single application data repository that saves any data type by inserting key-value pairs. An attempt to insert a duplicate key will trigger an Error.
Flest Framework was designed and built to be a lightweight and easy to use toolset that helps to structure the deveopment environment on the one hand, and gives a developer maximum freedom in making his/her own decisions on the other.
