All posts by Deril

Attending Reasons to be Creative (SEP 3-5,2012)

Hi,

I will be in Brighton attending Reasons to be Creative conference on September 3-5.

Feel free to approach me If you want to talk about mvcExprss! (… or just talk. :) )

I will have mvcExpress t-shirt with  “mvcExpress next step in AS3 framework evolution!” written on the back.

 

I think it is time for this framework to get more awareness, so I am planing to do presentations and workshops soon.

If you have idea/request for such presentation/workshop feel free to contact me: raima156 @ at yahoo. (I am located in Hamburg.)

mvcExpress 1.0.1 released!

Hi,

MvcExpress is released! (and updated a bit)

No real changes to API or functions will be noticeable from release candidate, but I put some time to improve tools for you to debug work with mvcExpress better.

I am currently actively learning how to write better unit tests(from “The Art of unit testing’ book and Udacity), I want to ensure rock solid quality of new features I want to add in next release, and ensure old once will not break.

I updated how MvcExpress.debugFunction works and added visualization of framework elements to ‘mvcExpress logger’ application.

As before you can get debug info by setting MvcExpress.debugFunction function.

For instance : MvcExpress.debugFunction = trace; will trace all activities.
But from now on this function will send TraceObj object, (that has toStnring() function) and it will hold all details about performed action(not only string text).

For example, lets imagine there is something weird going on with mediating TestViewA clases, and we want to understand what’s happening in details.
You could set debug function like this : MvcExpress.debugFunction = myDebugFunction;

Then define myDebugFunction function like this:

private function myDebugFunction(traceObj:TraceObj):void {
if (traceObj.action == MvcTraceActions.MEDIATORMAP_MEDIATE) {
if (traceObj.mediatorClass == TestViewAMediator) {
trace( "TestViewAMediator mediates :" + traceObj.viewObject);
}
}
}

now imagine putting brake-point on the trace – you get your code stopped with function stack and everything.

Of course.. writing custom debug functions in not fun… and it is needed in very rare cases, in most cases it is OK just to get a log what framework is doing. Thats what ‘mvcExpress logger’ application is for!

From now on it will not only have a text output of what framework does, what mediators are mapped… and so on.. but also it will show it visually!

To use it you need recent mvcExpress framework version, code for mvcExpress logger(because I fail to compile the damn thing into SWC.. :( ) and compile your application in debug compile parameter set to true.  To start using it add this line somewhere in your code before mvcExpress framework creates its first module:


MvcExpressLogger.init(this.stage);

And press: “CTRL” + “~” to open it.

Check out the demo here: http://mvcexpress.org/files/demos/mvcExpress_visual_logger.swf

Have fun!

mvcExpress 1.0.0 first release candidate is out!

Hi,

I finally came to version that I am confident to release, I still want to put it to release candidate state for a weak or two.

Changes:

New function added to get proxies at run time, as alternative to injecting your proxy.


proxyMap.getProxy(injectClass:Class, name:String):Proxy

This function is needed to get your proxy if you use dynamical name, or then you need some proxies rarely or in exceptional cases, and you don’t want to have public variable for it all the time.

For sending message to all modules new function added:

sendMessageToAll(type:String, params:Object = null):void

This approach is better then having parameter in sendMessage(). It will make cod more readable and understandable what code actually does.

To be honest – I don’t particularly like this function. I don’t like it so much that I felt that it is worth adding parameter to disable it :
MvcExpress.disableSendToAllFeature = false;

So the choice is yours weather you want it.

I can imagine scenarios there this function can be very useful, but I would like more controlled way to send my messages. (I will add alternative to this function in version 1.1)

Plus:

some small fixes, more unit tests, examples update and… documentation update!

Have fun.

framework changes before version 1.0

Hi,

I am preparing first stable framework release(v1.0), and I have ‘some’ changes coming. After release I will do only changes that are backward compatible.

I am very exited about these updates! they will give framework wider range of usage!   but first… lets get ugly out of the way. (These 3 changes are Backward Incompatible.) 

setDebugFunction(trace); is replaced with MvcExpress.debugFunction = trace;

debugFunction will still be called only with CONFIG:debug set to true, but setting it as constant is cleaner and more straightforward approach.

mediateWith() is removed

I have some mixed feelings about this function.
It could be potentially used to mess up single mediator mapped to single view object principle.
But in some cases maybe it could be used to more conveniently manage view objects… I still fail to architect such a case. In cases then objects needs different behavior it is better to subclass them into dedicated view classes and map dedicated mediators(even if view class will end up being empty.) So unless good work-flow scenario will need this function lets keep it out.

all sendMessage() function got new parameter: targetAllModules:Boolean = false. 

I was full of doubt about this change(an it is visible from my git log…), but couple of spectacularly failed module use case scenarios convinced me. Things can become ugly fast if you allow everything travel everywhere.

So from now on messages by default will go only to same model handlers there it was send from. You will have to manually specify witch messages you want to send out to all modules. It is less convenient, but it gives control back to programmers hands.  (I will prepare module use sample project to show how it works soon.)


ok… enough about the past… lets talk future!

Additionally to ModuleCore – ModuleSprite and ModuleMovieClip is added.

(ModuleApplication and ModuleGroup will be added for flex users soon.)

These new module classes is designed to create new modules easier and faster.

Sadly they are a bit confusing to newcomers as they end up having 2 responsibilities. One responsibility is to be a view object and another is setup/start-up a module. In practice you don’t have much code to write for one of those responsibilities, or you can do it with one line.

I talked with couple of people who liked the idea… and couple who hated. So I want to leave this as a choice: If you don’t like mix of responsibilities, use ModuleCore everywhere. If you want to have more straightforward module classes, and you know what you are doing – use ModuleSprite. (event if you end up having too much code for both mentioned responsibilities it is easy to re-factor it into 2 classes.)

Choice is yours.

New constructor parameter added to modules : moduleName

From now on all modules will have unique name. You don’t have to provide it if you don’t want to – framework will generate unique name (‘module1′, ‘module2’…)

(you have not much use for it yet… it will be used to resolve dependencies between modules in v1.1 and for better logging)

Added support for pending injections.

Support for pending injections means… that you can create the object, without having all of it’s dependencies ready. You have to specify how much time framework will be waiting for dependency to be set before it will complain.(by throwing error) If your object has pending injections – it will not be registered until it has them all.

By default this feature is disabled. you have to set : MvcExpress.pendingInjectsTimeOut  to milliseconds you want your application to wait for missing dependencies. (good idea is to give time for several frames to render. )

This feature solves circular dependency problem… (then ProxyA needs ProxyB, and ProxyB needs ProxyA.) (I will have sample soon.)

addListener, removeListener and removeAllListeners added.

These are added for better event management. All events will be weak referenced by default, also you will be able to remove all such listeners with one function!

If you remove mediator – removeAllListeners remorselessness will be called automatically.

Documentation is updated.
Both class and implementation documentation is written in details. It is far from professional documentation(as it lacks in-detail usage explanations with examples). But it is quite detailed and useful.


I am planning to release it in a weak or two. So everyone who use it could try out, suggest problems, fixes and ideas.

Thanks all for your support and ideas!

Have fun.

mvcExpress LIVE is coming!

Hi,

I want to announce development of “mvcExpress LIVE”.

It is a fork of mvcExpress framework that will add extra tools to handle real time action in applications. Like action in games, animatios, 3d rendering.

Problem – MVC patern works great for application that changes from state to state, but it is not good for something that needs rapid state change, like moving game elements or animations or other render processes.

Usually those things treated as black boxes in mvc, and handled internally.

I want to change that. I want those objects be not in that black box. I want them to be part of framework!

For that new actor will be added – processor.

Processor will have very simple job – run processes!

I will start by defining requirements:

  • it should not critically break MVC, or if it breaks it – have well error checking.
  • Items from proxies and mediators can be implemented to be handled by processes. (you will be able to see easily which items can be processed.)
  • Adding – removing process support should be simple re-factoring step.
  • process will do one and only on thing – run same actions over array of same type items. This array of items will be MAIN array.
  • processes will be able to get SUPPORT arrays of items to be used with MAIN array.
  • link beat-wean MAIN and  SUPPORT array will have to be defined. Error will be thrown if that definition is missing.
  • process will be running based on Timer intervals or on enter frame events.
  • processes will be able to run() other processes.
  • processes will have stop/play (reverse? ) functions..
  • it will be possible to add/remove items(by name) that are handled by processes easily.
  • it will be possible to send messages from process.

To be honest I am not sure if I will succeed to meet those requirements. What I am essentially doing is breaking MVC pattern, breaking it not critically, or manageable – and exchanging it to practical solutions that should benefit game making and other application with lot of live action.

This is my first prototype, everytihng you see is defined in MVC, but animated in processes : mvcExpressLive-prototype1.swf
(I don’t like implementation)

If I succeed – we will have 2 frameworks : “mvcExpress” and “mvcExpress live”.

First mvcExpress examples published

Hello,

I created a new git project for mvcExpress examples : https://github.com/MindScriptAct/mvcExpress-examples

You can fined 2 example projects there:

This is simple example that just trace some stuff to output.
It is well commented and covers all basic framework use concepts.

I recommend starting with this one.

Very simple example of ticTacToe game in action.

 

 

Small proxyMap change

To avoid confusion I decided to change proxieMap functions.

instead of having 2 functions to map proxies:

[as3 gutter=”1″]

proxyMap.mapClass(DemoProxy);
proxyMap.mapObject(new DemoProxy());

[/as3]

mvcExpress will have only one:

[as3 gutter=”1″]

proxyMap.map(new DemoProxy());

[/as3]

This will remove some confusion of proxy mapping, and better reflect proxy creation in framework.

mvcExpress, PureMVC and RobotLegs code comparison

Some time ago I wrote post in my blog there I compared PureMVC and RobotLegs framework code. I will re-post it here with improved code and added mvcExpress code examples.

If you come from PureMVC or RobotLegs and want to try mvcExpress – it will help you learn the difference. Or if you are new to AS3 frameworks – it will give you nice comparison.

Continue reading mvcExpress, PureMVC and RobotLegs code comparison