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]
1  PureMVC Manifold / MultiCore Version / Notification best practices on: July 18, 2008, 10:09:29
When dispatching notifications for informing about data availability (on proxies), what's the best practice: to send the data as the notification body, or to save the data as a property of the proxy, and let the mediator retrieve the data by calling up the proxy?
2  PureMVC Manifold / MultiCore Version / plugin initialization on: July 18, 2008, 06:52:32
Hi. This is more of an architectural question, but it's also related to the multicore framework.

I have an application that uses multicore to implement a plugin framework. I have a Shell application and several Plugins. Each plugin can be a puremvc application or not (that's up to the plugin implementation to decide). So in order to cope with that I am using a Shell/Plugin interface.

The thing is... let's say part of the interface is to provide to the shell some standard view components (like the 'view' view, the 'edit' view, etc...), so that the shell can inject the plugins view components into its own view components. My problem is currently that I don't know what's the best way to design such a system, and I am finding some issues with my current implementation.

The plugins are loaded at runtime (dynamically), and since the plugins don't have to be implemented in puremvc, I decided to do all the puremvc startup in the plugins init method (part of the plugin interface). That is, I am creating the view components from withing my actionscript class (but the components itself are defined in mxml files).

The thing is, view components are not created until needed, so my plugin gets initialized and when I try to access the view components for it, I get a null reference. I tried to use creationPolicy="all" to force the components to be created at startup, but it didn't worked as expected.

Now I was thinking of some way of delaying plugin initialization until all view components are created (and thus, I must somehow force the components to be created before they are actually needed), but couldn't yet find an optimal solution for this.

I hope I have stated my problem clear enough, so that you can help me by giving me some hints and tips about how to solve this.

Many thanks,

ricardo
3  PureMVC Manifold / MultiCore Version / loading modules dynamically on: June 03, 2008, 12:25:33
Hi,

I am writing some code to load modules dynamically. Each module is implemented as a standalone application (meaning it has it's own Facade, Model, View and Controller). I am using (in my shell application)  a ModuleProxy, which loads and unloads modules. While they are loaded, the proxy keeps a reference in an ArrayCollection.

The strange thing is, I can load a module perfectly the first time, then unload it without any problems, and if I want to load it again afterwards, I get an error in the module's main mxml (which has the Module tag), saying that it "cannot access a property or method of a null object reference". This happens in the creationComplete event handler which looks like

<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
    verticalGap="0"
    horizontalGap="0"
    creationComplete="facade.startup(this);">
    <mx:Script>
        <![CDATA[
        import my.name.space.ApplicationFacade;
        public static const NAME:String = 'MyModule';
        protected var facade:ApplicationFacade = ApplicationFacade.getInstance(NAME);
        ]]>
    </mx:Script>
...
</mx:Module>

so that means, the null object reference is the facade object, right?

Now, what does this exactly mean? Why is it null the second time I try to load the module, but not the first time?
4  Announcements and General Discussion / Architecture / plugin architecture and updates on: May 28, 2008, 08:32:37
Hi. For the design of my app I am thinking of using something like "plugins". What I want to have is this:

The main app basically consists of a product (for some definition of product) editor. The list of available products is dynamic, so that you will only have the choice of products among the products available at run time (I want to be able to add/remove available products on demand, so compiling everything right into the swf file is not the best option). I thought of using modules or something like that, so that I could just drop a new file into the app's directory and it would (when started) detect the new product implemented in that file, and make it available. That file should hold the product's view, model and controller parts (i.e. everything that is necessary to work with that product).

This way of architecting my app is to enable updates without having to download the whole app's code again.

I hope the main idea is clear. Now my question is: what is the best way to architect my app in order to achieve this? Are modules the answer? or RSL/SWC?
Can I use the standard AS3 version of the framework, or do I have to use the multicore version?

On a side note.. how would you manage updates to your app's functionality, in general?

Any ideas or suggestions (and critics) are welcome.

Ricardo
5  Announcements and General Discussion / Architecture / Data Layer Abstraction on: May 21, 2008, 12:22:24
Hi. I am completely new to PureMVC, and somewhat new to Flex, but I have to develop a new application using Flex, and I though of giving PureMVC a chance.

One of the requirements of the App is that I should be able to change the underlying plattform as seamlessly as possible. By that I mean, that if I decide to start developing the app using XulRunner as a plattform, and later on I decide to better use Air, I should be able to do that as easily as possible. On the other hand I will be initially using a sqlite database for my data, but I would like to be able to later use a webservice api for invoking data storage on a remote server.

So, regarding this last requirement, I though of the following. All my proxies should just use a service for setting/getting the data, and the service should just implement an interface, so I could eventually change the underlying implementation in order to access a database through filesystem, or access a remote api through webservices, without affecting the rest of the application. In the event of changing where the data is stored, I should only have to replace the service's implementation, but not alter the proxies.

I just wanted to have your oppinion on this, what weak points you see, and/or how you would modify it for better abstraction/performance/ease of use.

thank you in advance,

ricardo
Pages: [1]