Posts Tagged ‘PureMVC Goals’

Pure MVC

March 4th, 2010 by

Generally we find that an application starts with a defined architecture like (MVC, Abstracts etc.) But when it reaches to its final stage, it loses its defined architecture and become a mixture J. To avoid this in current scenario ,most projects are using some kind of framework  as  a set standard.

framework will provide the following benefits:

  • Help build complex applications faster
  • Support code reuse
  • Support maintainability and extensibility

Either framework will help you build modular, loosely-coupled applications using consistent methodologies that are founded on the well-known MVC pattern. However, there are also some significant differences in the frameworks.

PureMVC is a lightweight framework for creating applications based upon the classic Model, View and Controller concept. Based upon proven design patterns, this free, open source framework which was originally implemented in the ActionScript 3 language for use with Adobe Flex, Flash and AIR, has now been ported to nearly all major development platforms.

Implementation:

  1. Standard Version
  2. MultiCore version

Two big established frameworks are ARP and Cairngorm (for Flex), and there are a bunch of other less well known frameworks, lots of which are available from OSFlash

Communication between object is mostly done using PureMVC’s own Notification system rather than AS3 Events – this seems an odd design decision, but now that PureMVC is being ported to a whole host of different languages which do not support AS3 Events (Ruby, Python, HaXe, etc) this makes sense.

Why PureMVC ??:

  1. 1. Agility : Change data handling or Interface without effecting others
  2. 2. Reusability : View Components and Data Model
  3. 3. Clarity : Best Practice for Complicated application.

PureMVC Goals :

1.Light weight framework for creating application in Action Script 3.0

2.  No dependency on Flex, Flash or AIR

3. Reduce confusion by defining best practices for class roles, Responsibilities and Collaborations.

4. Hide complexity from the Developer.

PureMVC  vs. Cairngorm

One key difference is that PureMVC is not tied to Flex or even ActionScript. The advantage of this that PureMVC can be used for other languages, and in fact has been ported to eleven different languages to date. The disadvantage of this is that PureMVC does not leverage native Flex features; for example, rather than using Flex binding or the native Flex event delegation model, PureMVC uses its own publish/subscribe notification system.

On the other hand, Cairngorm relies too much on Flex binding, and does not provide another way of notifying the view when a relevant event has occurred in the controller or when the model has been updated. For this reason, many experienced Cairngorm developers dispatch Cairngorm events from Commands and listen for these events in the view components – something which Adobe’s training material explicitly discourages.

Another issue with Cairngorm is that it encourages the proliferation of small classes containing boilerplate code (i.e. events and commands). While developers have found various ways around this, most of these workarounds are – again – expressly discouraged by the Cairngorm documentation and training materials.

It might be argued that the framework can’t be blamed for the fact that people misuse it. On the other hand, it could also be argued that if even experienced, senior-level developers find it too onerous to manage without making some illicit modifications, then perhaps the framework has some room for improvement.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,