Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: 1 [2] 3 4 ... 6
16  Announcements and General Discussion / Fabrication / Re: Another small request on: February 21, 2009, 07:45:52
Hey Jason,

The applicationInstanceName code and tests are on SVN. I haven't been able to work on the direct hooks to IFabrication in the lifecycle yet. My work commitments have left me with very little spare time recently. I will have more time to work on this after the next week or so.

I have tried to make building of Fabrication swc's from the svn very easy with an ant based build system. To build an swc use, ant swc, ant swc-flex, etc. This will produce the corresponding swcs in the dist folder.

peace,
darshan


17  Announcements and General Discussion / Fabrication / Re: Starting on a PureMVC multicore Fabrication generator gem on: February 19, 2009, 07:55:23
Hey Steffen,

Thanks for trying Fabrication. The generator idea sounds really great. I have been meaning to do something like that but have been a little busy at work. I have used Rails a few times recently and it is always a lot of fun to work with.

I think the nicest thing to have would be Component generators. For instance most of my Proxies cast the data to the concrete data type for a little strong typing.

:
public function get list():ArrayCollection {
   return data as ArrayCollection;
}

The generator for this could be something like,
:
script/generate Proxy Name Parent DataType

Another generator I would love to see is the Mediator generator. I have added support for Reactions recently. Now if I have a flex component like an AlbumList.xml,

:
<mx:List id="list" />
<mx:Button id="refreshButton" />

And if I need a mediator for this like, AlbumListMediator. I could generate it using a component generate like,

:
script/generate Mediator AlbumListMediator AlbumList.mxml listChange refreshButtonClick

This generates the get componentName from the component and the reactTo method handler like
:
public function get albumList():AlbumList {
   return viewComponent as AlbumList;
}

public function get list():List {
   return albumList.list as List;
}

public function get refreshButton():Button {
   return albumList.refreshButton as Button;
}

public function reactToListChange(note:INotification):void {

}

public function reactToRefreshButtonClick(note:INotification):void {

}

Thats a lot of code to generate. But if you can get the ids from the mxml you can write the get componentName getters. Then the reactions come naturally. Also some bootstrap tasks would make sense. Like a plain old,

:
fabrication ProjectName ProjectType

Which generates the Main mxml or class and a startup command and possible a constants class. Another thing that can be scaffolded is any kind of undo that extends SimpleUndoableCommand. Some of this is crossing over into scaffolding type stuff rather than just generation. Looking forward to your thoughts.

peace,
darshan
18  Announcements and General Discussion / Fabrication / Re: respondTo on: February 05, 2009, 04:01:47
Some of the examples aren't doing multi-modular stuff but showcase some of the other aspects like undo-redo etc. So I haven't included getClassByName in it. The respondTo syntax implementation is based on reflection hence the need for getClassByName. You need getClassByName in modular stuff and AIR. If you can post some code, I would be able to help better.

The FabricationMediator and subclasses return notification interests reflected from respondTo methods in the listNotificationInterests. You could append any other notifications to it and return it in the subclasses. And in the handleNotification method call super.handleNotification.

peace,
darshan
19  Announcements and General Discussion / Fabrication / Re: Another small request on: February 01, 2009, 07:51:10
After some more thought I think the initializeEnvironment could be added as a hook within the IFabrication interface itself. ApplicationFabrication would implement this call and subclasses call super.initializeEnvironment or not to override this behaviour. Make sense?

peace,
darshan
20  Announcements and General Discussion / General Discussion / Re: Multicore Pipes vs Fabrication on: January 30, 2009, 04:01:37
Hey Marcy,

This sounds like a good idea to me. In my current implementation I am maintaining hash maps by module address and groups. So something like module-to-module notification with/out groups go directly to each other without loops.

Your idea is fairly clean way of doing things using existing information about cores. I will look into incorporating some of this into future versions once I get into optimization mode towards 1.0.

peace,
darshan
21  Announcements and General Discussion / Fabrication / Re: Another small request on: January 30, 2009, 03:45:26
Hey Jason,

The fabricationCreated event should only really be sent when the application's fabrication has finished initializing completely. That way if the shell/parent needed anything from the child module in the fabricationCreated handler, it has that information. I tried swapping those lines but it breaks the unit tests. Also a couple of flex demo's depend on the module having finished initializing when the fabricationCreated event is received.

Another way to achieve this is to hook into the init sequence of fabrication which is,

  • initializeModuleAddress()
  • initializeFacade()
  • initializeEnvironment()
  • startApplication()

The hook method to do what you are looking for is initializeEnvironment. You mentioned you have a ModuleApplication. You need to add a custom fabricator to it. In the ModuleApplication, You need to override initializeFabricator like

:
override public function initializeFabricator():void {
   _fabricator = new ModuleApplicationFabricator(this);
}

And in the ModuleApplicationFabricator < FlashApplicationFabricator do,

:
override public function initializeEnvironment():void {
   super.initializeEnvironment();

   facade.registerInterceptor("fooNote", FooInterceptor);
}

peace,
darshan
22  Announcements and General Discussion / Fabrication / Re: Fabrication - Simplified PureMVC multicore modules on: January 29, 2009, 02:43:53
Hi Benjamin,

Fabrication is released under Apache 2.0 because this was a requirement at my company. Creative Commons is not suitable for software is what I was informed. Apache 2.0 is what I was asked to use. It is unlikely that I would be able to change the Fabrication license to Creative Commons. Sorry.

peace,
darshan
23  Announcements and General Discussion / Fabrication / Re: Something amiss with 0.6 (Flash fails to compile) on: January 27, 2009, 03:20:06
Hey Jason,

I have fixed this on SVN. I moved out the internal classes. Also added the change to the ApplicationFabricator that you had suggested. Can you confirm this works for you? Also I noticed that CS4 supports swcs now. I am thinking of creating an swc for it. Is there anything different about CS4 swcs?

peace,
darshan
24  Announcements and General Discussion / General Discussion / Re: Multicore Pipes vs Fabrication on: January 26, 2009, 09:26:06
@quinrou, sorry to jump into this thread. I would like to clarify this, Not sure how you got to 500kb. The entire fabrication swc is around 70kb, the framework can't be bigger than that ;-). And depending on whether you are using flash or flex and which parts you use the footprint will be smaller. For instance this example is around 30 kb including 10kb of PureMVC itself.

peace,
darshan
25  Announcements and General Discussion / Fabrication / Re: Something amiss with 0.6 (Flash fails to compile) on: January 26, 2009, 09:15:21
Thats too bad. Internal classes should really have been supported. Guess this must have slipped through QA. I will switch to externals in the framework and make an update. Thanks for reporting this.

peace,
darshan
26  Announcements and General Discussion / Fabrication / Re: How to convert apps to fabrication modules? on: January 22, 2009, 12:05:40
Hey Mark,

To Convert Applications to modules means changing the base class of your main application from FlexModule to FlexApplication. The shell application would load the FlexModules with the FlexModuleLoader.

:
var moduleLoader:FlexModuleLoader = new FlexModuleLoader();

moduleLoader.url = "moduleX.swf";
moduleLoader.router = applicationRouter;

addChild(moduleLoader);

For sending messages between the modules you can use the routeNotification method available throughout Fabrication's commands, mediators, etc. If your modules are called ModuleX and ModuleY. You can send messages to and from using routeNotification as,

:
// module X to Y
routeNotification("myNote", myBody, "myType", "ModuleX/*");

// module Y to X
routeNotification("myNote", myBody, "myType", "ModuleY/*");

// shell to both X or Y
routeNotification("myNote", myBody, "myType", "*");

There are some other considerations when switching between applications to modules if you are using Flex 3.2+ to do with the Marshall plan. This mostly to do with how you subscribe to system events and such.

I suggest taking a look at the Example applications like simple_routing. Hope that helps.

peace,
darshan
27  Announcements and General Discussion / Fabrication / Re: Fabrication - Simplified PureMVC multicore modules on: January 21, 2009, 11:50:58
Hey Grant,

Like Jason mentioned, the list of changes is here. 0.5 is the version to get with the fixes for the memory leaks. 0.5 was the biggest release so far and brought in the unit tests and fixes to some other reported bugs. 0.6 is the currently release with a Interceptors, Reactions and ModuleGroups.

When I started, Fabrication was just the routing layer on top of pipes. The scope of the project has since changed as I have added features that I think are needed to program in PureMVC in a more efficient manner. Initially I tried to do things from a pov of a PureMVC utility. However features like Reflexive Mediator registration and Interceptors can not be done without extending the core PureMVC actors.

Fabrication will continue on this path and add any features that are useful to general PureMVC development. I will maintain compatibility with PureMVC and any of its utilities as long as it makes sense. Nevertheless It would be nice to be officially linked from the PureMVC site. It is released under the Apache license, and any code contributions are welcome. ;-)

peace,
darshan
28  Announcements and General Discussion / Fabrication / Re: Fabrication 0.6 on: January 09, 2009, 08:11:53
I forgot about that. Yes modules groups are also in.

peace,
darshan
29  Announcements and General Discussion / Fabrication / Fabrication 0.6 on: January 09, 2009, 03:47:56
Hi All,

I have release Fabrication 0.6[1] with some of the features that I mentioned over the last few days on this forum. The Interceptors[2] feature I showed to make Fabrication work well with the StateMachine utility is in this release. 0.6 also adds one important feature, Reactions.

Reactions is a way to indicate interest in a component event and listen for that event in the same step. This is very similar to the respondTo convention used with Reflexive Notification interests. With Reactions to listen to the Click of MyComponent, you just declare a method like,

:
public function reactToMyComponentClick(event:MouseEvent):void {

}

You can also use trapMyComponentClick for capture phase reactions. You can find more details about it here[3].

peace,
darshan

[1] : http://code.google.com/p/fabrication/downloads/list
[2] : http://code.google.com/p/fabrication/wiki/Interceptors
[3] : http://code.google.com/p/fabrication/wiki/Reactions
30  Announcements and General Discussion / Fabrication / Re: Fabrication - Simplified PureMVC multicore modules on: January 08, 2009, 07:29:38
Hey Chris,

Can you try adding the following method to your main mxml file.

:
override public function getClassByName(classpath):Class {
   return getDefinitionByName(classpath) as Class;
}

This code is needed with modules. The documentation assumes information that is mentioned in the later wiki pages. I will try to improve this. If you can post your source files I can provide move information.

peace,
darshan
Pages: 1 [2] 3 4 ... 6