Asynchronous programming and MetaData
Posted in Programming Philosophy, Quark framework on September 4th, 2010 by sinica – Be the first to comment Tags: asynchronousEven if asynchronous programming can get tricky, it enables a beneficial declarative coding style. I will present a few use cases for which benefits outweighs the risks (risks that could come from bad/stupid programmers mainly):
- Form validation. Data validation is a natural part of the model (remember the fat model idea) and it is not part of view for sure. With triggers in quark, it is possible to easily set metadata about invalidity of fields/objects and the view will just reflect changes in metadata.
- Loose coupling in MVC and support for View States (quark terminology). The idea is that a type of data (an object) should be differently viewed by the user depending on internal values. In quark, asynchronous triggers will watch member values, set a ViewState metadata and the view is switching to a proper view. Imagine doing this in a pure procedural way… This solution offers the best possible loose coupling in Quark’s MVC (only one way loop communication between V-> C ->M->V in this order) .
- Implementation of the business rules layer. A way to enforce specific business rules on the quark models is by using triggers that will watch values and as result will create new objects,change values.

Leave a Reply