haxe 3 MMVC - just some thoughts

125 views
Skip to first unread message

Robin Burrer

unread,
Aug 8, 2013, 9:33:34 AM8/8/13
to haxe...@googlegroups.com

Hi list,


I finally had the chance to take a closer look at haxe 3. During the past four month I was working on two fairly large haxe 2 projects. For both projects I used Massive Interactive’s port of the robotlegs framework (MMVC).

I thought switching to haxe 3 in the middle of a project would be too much hassle. 


I must say that I was wrong. The transition to haxe 3 is really easy. I also noticed that I wouldn’t have to have changed a single line of MMVC related code. The haxe 3 version of MMVC just worked out of the box - great work!


I really love the new haxe 3 HTML5 API, which I going to use in a new project I just started.


I use haxe for HTML5, Android and iOS development (trough Adobe air). MMVC is a great Framework because I allows me to use seamlessly switch between these targets and to reuse my code across platforms.


I just updated my MMVC “hello world” example to haxe 3. (https://github.com/robinburrer/mmvcexample). It’s really basic but it shows some of the approaches I use in most of my projects. Any comments are welcome.


Robin

Cambiata

unread,
Aug 8, 2013, 11:22:03 AM8/8/13
to haxe...@googlegroups.com
Hi Robin and others!

Just want to add some praise to the mmvc solution. I'm in the middle of a larger project with three Haxe sub projects: one standard flash, one OpenFL and one AIR. Some weeks ago I decided to rewrite the solutions using mmvc, and once setting things up (including preparing FD templates for the mmvc "pairs" (signal/command in one module, view/mediator in one module etc) the development is a joy!

In addition to mmvc, I use mloader and msignals, and for the front ends StablexUI.
Looking back one year, lots of great things have happened on the Haxe stage, and massive's contribution to this has been, well, massive.

/ Jonas

Axel Huizinga

unread,
Aug 8, 2013, 12:07:34 PM8/8/13
to haxe...@googlegroups.com
Am 08.08.2013 17:22, schrieb Cambiata:
Hi Robin and others!

Just want to add some praise to the mmvc solution. I'm in the middle of a larger project with three Haxe sub projects: one standard flash, one OpenFL and one AIR. Some weeks ago I decided to rewrite the solutions using mmvc, and once setting things up (including preparing FD templates for the mmvc "pairs" (signal/command in one module, view/mediator in one module etc) the development is a joy!

could you share the FD templates?
In addition to mmvc, I use mloader and msignals, and for the front ends StablexUI.
Looking back one year, lots of great things have happened on the Haxe stage, and massive's contribution to this has been, well, massive.

/ Jonas
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Zjnue Brzavi

unread,
Aug 8, 2013, 12:14:37 PM8/8/13
to haxe...@googlegroups.com
Hi,

I just updated my MMVC “hello world” example to haxe 3. (https://github.com/robinburrer/mmvcexample). It’s really basic but it shows some of the approaches I use in most of my projects. Any comments are welcome.


Last time I checked NME / OpenFL did not dispatch Event.ADDED and Event.REMOVED consistently across targets.
If it did, hooks into mmvc would have been a simpler matter. In your example, the View.hx class more or less acts as a workaround for this situation.
 
In addition to mmvc, I use mloader and msignals, and for the front ends StablexUI.

Not sure how you use mmvc with StablexUI, but if you apply the following changes:
https://github.com/zjnue/StablexUI/commit/671d592b7303098d9dd602386eecb0ddedb0e375

..you could say have the following instead for AppView.hx in the example:

class AppView extends Widget implements mmvc.api.IViewContainer {

  public function new() {
    super();
    addMvcListeners();
  }
   
  // your code here
   
  // mmvc boilerplate   
  public var viewAdded : Widget -> Void;
  public var viewRemoved : Widget -> Void;
   
  inline function addMvcListeners() {
    UIBuilder.dispatcher.addEventListener( WidgetEvent.ADDED, function(e:WidgetEvent) viewAdded(e.widget) );
    UIBuilder.dispatcher.addEventListener( WidgetEvent.REMOVED, function(e:WidgetEvent) viewRemoved(e.widget) );
  }
   
  public inline function isAdded( view : Widget ) {
    return true;
  }
}


br,
Zjnue

Reply all
Reply to author
Forward
0 new messages