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 ... 5 6 [7] 8 9 ... 11
91  Announcements and General Discussion / General Discussion / Re: [Loadup Utility] Reference to UIComponent on: October 23, 2009, 10:47:43
I already have a working version of it, I don't remember if the integration was complete. I need to integrate it in an example project. I will try to do it this week-end. If I can't finish it, I'll send you a PM to give you a link to the last version of it.
92  PureMVC Manifold / Standard Version / Re: Unit testing with PureMVC: recreating the singletons for each test on: October 22, 2009, 01:05:02
If you use the PureMVC multicore version you can create and remove a Facade :

:
public function testAdd():void
{
var data:ArrayCollection = new ArrayCollection([]);
var proxy:MyProxy = new MyProxy( 'UnitTestProxy', data );

var facade:IFacade = Facade.getInstance( "FacadeName" );
facade.registerProxy( proxy );

var item:MyClass = new MyClass('0123456789');
proxy.add( item );

assertTrue
(
"Expecting proxy.containsValue( item ) == true",
proxy.containsValue( item )
);

Facade.removeCore( "FacadeName" );
}

Upgrading from PureMVC single-core to PureMVC multi-core only take 5 minutes.

But you're probably right, a method to deference the instance in the single core Facade is probably a good idea.
93  PureMVC Manifold / MultiCore Version / Re: Thinking of using the Pipes Utility. on: October 21, 2009, 01:12:19
You can have a look at the application I made in pure ActionScript with Modules and Pipes : http://www.tekool.net/blog/2009/08/09/flash-only-modules-with-puremvc-pipes-demo/

Hope this helps.
94  Announcements and General Discussion / Architecture / Re: Sharing proxy between cores on: October 18, 2009, 07:34:44
You're right on the SharedObject deactivation. This was definitively a bad idea, sorry. I want to introduce this because I'm currently working on an application running in two different SWFs, I need and use the SharedObject to store VOs and use the same proxys classes in the two SWFs to access data, I found this elegant. But in the same application, finally it's like using a global context, quite a bad practice.

>This sounds interesting; is the term "module" here used in the Pipes context or in the context of
>a Facade like UserInfoFacade which would be dedicated to managing user information, expiring sessions etc.?

You can use modules without pipes, even if pipes are recommended to let modules communicate http://trac.puremvc.org/Demo_AS3_MultiCore_Flex_Modularity . It's rather easy to integrate Pipes when you already have integrated modules with a clean API for each.

>On a related note, I hope it isn't an anti-pattern to have a facade which isn't related to a concrete view per-se?
 I recently have asked this on the forums, Cliff answered it here : http://forums.puremvc.org/index.php?topic=1445.0

95  Announcements and General Discussion / Architecture / Re: Sharing proxy between cores on: October 17, 2009, 01:55:32
If sharing user VO across cores is important for your application because it contains some data that cost high to retrieve (e.g. from a server), the easiest way to achieve this imho, is to share the same proxy class but not the same proxy instance in your different cores. You can use a local file (SharedObject if you use Flash) to store user info and use the same Proxy class (not the same instance) in all your cores to read the user VO stored in the SharedObject without any tight coupling between cores.

A better but more complex solution is to implement PureMVC Pipes and to punctually ask for a UserVO clone through pipes to the module that have role to retrieve user infos from the server. If the application is large enough the definitive solution is to have a module dedicated to user info management, each module asking or receiving user infos updates.
96  PureMVC Manifold / Demos and Utils / Re: AsyncStub - A PureMVC AS3 Utility on: October 14, 2009, 03:59:04
Thank you very much! :) I can now use the regular SWC in my current project.
97  Announcements and General Discussion / General Discussion / Re: [Loadup Utility] Reference to UIComponent on: September 25, 2009, 05:13:01
I investigated the problem a little deeper and I found that the Loadup AssetFactory is already well written and so you can create your own AssetTypeMap without having to modify the existing AssetTypeMap  class as there is a IAssetTypeMap interface and no refereence to the concrete AssetTypeMap exists in the utility. This is exactly what I was looking for.

Now, the problem is real with the default class and I suppose that a good thing would be to rename the exisiting AssetTypeMap to FlexAssetTypeMap. For my part as my project is pure ActionScript I will have to create a PureAsAssetTypeMap. If the result is interesting I could post a Pure Flash example for Loadup with the required AssetTypeMap/MapToLoaderContext/MapToURLRequest for Pure ActionScript projects. It could be added to the project later.
98  Announcements and General Discussion / General Discussion / [Loadup Utility] Reference to UIComponent on: September 25, 2009, 02:41:33
While working with the Loadup Utility I realized that the three classes AssetOfTypeImage, AssetOfTypeSwf, AssetOfTypeText, implementing IAssetForFlex all make direct references to UIComponent. It first add unwanted weight to a pure ActionScript application and probably introduce problems to compile it from Flash IDE.

The reference to this three classes is not a problem in itself as they are intended to provide helpers for Flex components.

The problem is more that even if the utility implements an Asset Factory, the class AssetTypeMap make a reference to this three concrete class instead of letting the user choose the concrete class to build.

Here is the incriminated references in AssetTypeMap

:
39         protected function defaultMap() :Object {
40             var obj :Object = new Object();
41             obj[ Loadup.IMAGE_ASSET_TYPE ]     = [ AssetOfTypeImage, AssetLoadByLoader ];
42             obj[ Loadup.TEXT_ASSET_TYPE ]      = [ AssetOfTypeText, AssetLoadByURLLoader ];
43             obj[ Loadup.SWF_ASSET_TYPE ]       = [ AssetOfTypeSwf, AssetLoadByLoader ];
44             return obj;
45         }


To be honest, now, I don't have much time to explore this deeper. For my current needs, I simply modified the AssetTypeMap class to initialize its constructor with my own "defaultMap" which did not contains any UIcomponent reference.

But I'm sure we can do it better with a good implementation of an Abstract Factory where only the user create the client class which will decide to use or not use the UIComponent in the assets it needs.
99  Announcements and General Discussion / General Discussion / Re: Best method for caching objects created by mediator on: September 17, 2009, 12:46:10
facade.register new Proxy("NowAndLaterData", data);

Brilliant ! :)
100  Announcements and General Discussion / General Discussion / Re: Non-visual module used as core in multicore on: September 17, 2009, 12:36:07
Thank you Cliff for the answer.

I will use Flex modules with an API defined by the Pipes message that each module can send or receive.
101  Announcements and General Discussion / General Discussion / Re: Best method for caching objects created by mediator on: September 16, 2009, 02:43:51
The best method for you here is probably to keep the drawing made by the lines in a Sprite that you add to the display list of the view that your mediator gives access. You can easily made it visible or invisible if needed. You also have to keep a local copy of the VO that gives you the data associated with the drawing.

When the proxy receives data it will send a notification. Your mediator will have access to a VO associated with the result. You can add a method to this VO that will compare itself to another of the same type. When received you use the VO.compare method to compare the new vo to the older. If they are the same, you just have to make the Sprite visible, if they are different you'll have to redraw it.
102  Announcements and General Discussion / General Discussion / Non-visual module used as core in multicore on: September 15, 2009, 08:00:13
I often have the same problem. I need to use a connection protocol or a specific type of server that requires me to have a group of 3 or 4 proxies to manage each type of connection to do near the same thing. I have to use alternatively one or another type of server in different build of the same app.

I have no problem to implement the same interface in my different proxies type, use the same commands when needed and decide which type of proxies and command to use when registering command/proxies. But I find more elegant not to have to worry about the two different proxies type simultaneously in the same project, even if I separate them into different packages. A native implementation of the IOC in PureMVC here would have probably been the solution to my problem. But I'm afraid that looking into and using Spring ActionScript for PureMVC or another solution take me too long for the project I'm working on.

So I wonder if this might be a good practice to create a core that would have no visual elements at all. Only a mediator for the application class, a group of 3 or 4 proxies and at most one state machine to manage the connection / disconnection when it is persistent one. Pipes literally controlling the module from the shell and other modules, even if I have some basic controller for initialization ?
103  PureMVC Manifold / Demos and Utils / Re: AsyncStub - A PureMVC AS3 Utility on: September 10, 2009, 05:32:43
Philip, can you add a multicore source folder to the utility ?

I made it by myself, it takes me only two minutes. ;)

Thanks a lot.
104  PureMVC Manifold / Standard Version / Re: Problem with MacroCommand on: September 04, 2009, 12:25:46
While having a quick overview of the MacroCommand class in AS2, there seems to be errors in it.

initializeMacroCommand and addSubCommand must be public, as protected doesn't exists in AS2. You'll have to modify it by yourself and ask the author (Pedr Browne <pedr.browne[A]puremvc.org>) of this port to correct the errors ASAP.
105  Announcements and General Discussion / General Discussion / Re: Shell Global Content Sharing in a Multi Core/Pipes application on: August 16, 2009, 06:48:42
And it is not always true that the shell should be the smallest and the modules larger, in fact it may often be the other way around, since the shell often includes all the shared stuff *including* Flex, PureMVC and Pipes.

Of course, I explained this in my answer in the next paragraph. ;) I was talking about the logic it may contains. In my opinion shell must as possible only contains the logic needed to load, unload modules and setup,tear down pipes.

: polykrom
when you say that each module may run alone, in my case, it's not possible cause i get content and relation between shell and modules with pipe... so when i launch my module .swf, it doesn't display anything..
I mean that it may compile without any dependencies to shell and must be able to launch without without any runtime error. Of course, it most cases it will not do anything without Pipes.
Pages: 1 ... 5 6 [7] 8 9 ... 11