simplest!

mvcExpress is the simplest MVC architecture framework there is!

 

Minimalistic:


while working with mvcExpress you need to know 10 things only!

4 classes:

ModuleCore.as

extend to create core framework class that starts it all. Represents singlemodule unit of your application

Command.as

extend for executable command for your business logic.

Proxy.as

extend to provide your data objects with direct access API.

Mediator.as

extend to create indirect communication for your view objects to rest of application.

3 objects:

commandMap

map your command’s to messages, and do direct execution of commands.

proxyMap

map your proxies  for injection.

mediatorMap

map your mediator classes to view classes, and mediate your view object .

3 functions for communication:

sendMessage()

send messages from ModuleCores, Commands, Proxies and Mediators.

message can trigger mapped command or handler function in Mediators.

addHandler()

add message handler function in Mediators.

removeHandler()

remove message handler function in Mediators.

 

Hard to misuse:


while working with mvcExpress you will have what you need where you need it. No more no less.

If something is not available in your class – it means it is restricted by MVC pattern or bad practice.

 

Modular:


Want it or not – you will be creating reusable modules by extending ModuleCore.as class.

To start benefit from modular programming concepts you just need to place couple of modules in convenient folder structure, and send some messages around from one module to another. (no special classes of functions needed.)

 

Supports dependency injection:


mvcExpress supports class injection with meta-tag [Inject] similar how RobotLegs does. This is not only useful for Test driven development, but also makes getting your proxy objects in mediators and view object an easy task!

 

Helps avoid errors:


mvcExpress uses conditional compilation very extensively!

Add “-define+=CONFIG::DEBUG,true” to your debug compile options and you will benefit from better error checking and warnings if you forget something important. Leave it out from release compilation and you will enjoy framework speed! If you use FlashDevelop you don’t need to do anything because this is already set-up for you by default!

If you decide to store your message types in dedicated classes as string constants – mvcExpress have a nice utility for you to help you avoid duplicated strings:

checkClassStringConstants(ClassName1, ClassName2);

2 thoughts on “simplest!”

  1. Can you provide stack-trace of event dispatching from dispatch to capture of event?

    I am interested will we have same tonns of function calls like we have withing parsley framework.

    1. Sure!

      this is full MVC triangle cycle.
      (handling event by command is about half of it..)

      Custom view event is sent on user click ->
      view message is handled by command ->
      command set data in proxy ->
      proxy send message ->
      view shows it.

      (Stack has to be reed from bottom to top.. of course.)


      ticTacToe.view.gameScreen::GameScreen/addToken():85
      ticTacToe.view.gameScreen::GameScreenMediator/handleCellSet():48
      mvcexpress.core.messenger::Messenger/send():168
      mvcexpress.mvc::Proxy/sendMessage():92
      ticTacToe.model::GameBoardProxy/setCellToken():37
      ticTacToe.controller.game::CellClickCommand/execute():39
      mvcexpress.core::CommandMap/http://mvcexpress.org/::handleCommandExecute():387
      mvcexpress.core.messenger::Messenger/send():157
      mvcexpress.mvc::Mediator/sendMessage():123
      ticTacToe.view.gameScreen::GameScreenMediator/handleCellClick():38
      flash.events::EventDispatcher/dispatchEventFunction()
      flash.events::EventDispatcher/dispatchEvent()
      ticTacToe.view.gameScreen::GameScreen/handleBackClick():80

      … one of reasons why mvcExpress is fastest mvc framework is – small stack trace!

      This comment inspired me to do this page : http://mvcexpress.org/documentation/misc/mvcExpressFunctionStack.html

Leave a Reply to Deril Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

simplest and fastest ActionScript 3 MVC framework