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  Announcements and General Discussion / General Discussion / About code structure on: November 09, 2011, 11:24:14
Very quick and simple question.

What's the best practice if I have a variable that will be used by many mediators and skins and that I don't want to duplicate (a Matrix value). Should I place it in the facade?

Thanks
2  PureMVC Manifold / Standard Version / Re: PureMVC and FlashBuilder Modules on: November 04, 2011, 06:03:47
Thanks! I am not sure to be able to make it work myself, but I'll try anyway  :)
3  PureMVC Manifold / Standard Version / Re: PureMVC and FlashBuilder Modules on: November 03, 2011, 07:44:09
Hi Cliff

Thanks for your answer.

I read your page http://puremvc.org/content/view/75/181/ and Joshua Ostrom post http://www.joshuaostrom.com/2008/06/15/understanding-puremvc-pipes/

I've also been through PipesWork demo and this is exactly what I need. But once compiled, the project consists on a single swf file instead of a 'shell.swf' and modules as other swf to be dynamically loaded. Do you know any example of swf module loaded dynamically, cause I don't have enough deep knowledge to tweak PipesWork demo for this purpose.

Thanks again, this clarifies a lot!
4  PureMVC Manifold / Standard Version / PureMVC and FlashBuilder Modules on: November 02, 2011, 10:57:59
Hello

I have rewriten this post as I finally found many tips on other threads and demo examples.

I just want to be sure here that I am using the right technology:

I need to build a modular application (...doesn't mean that I will use Flex modules). The idea is that a Shell application is distributed to the client with some modules included, depending on his needs. So I would like to include a module manager utility in the shell and load/unload some specific modules delivered as zip files, extracting them in the right place through this utility. Then by restarting the application, these modules are loaded (or loaded on demand) and all communicate to the Shell in both directions.

Do I really need modules or RSL? Do I need Multicore for this purpose? Is this a typical Pipe application?

Thanks for any thought or tip!
5  Announcements and General Discussion / Architecture / Re: RetrieveMediator for multiple instances on: October 19, 2011, 01:07:51
Right! Still have a lot to learn  :-\
6  Announcements and General Discussion / Architecture / Re: RetrieveMediator for multiple instances on: October 19, 2011, 12:42:04
Ok. I could for instance code some static const variables in MyComponent and refer to these in MySubComponent as identifier.
7  Announcements and General Discussion / Architecture / Re: RetrieveMediator for multiple instances on: October 19, 2011, 11:54:17
You don't need to retrieve the MyComponentMediator, you just need to send a notification it is interested in. Yes, both instances of MyComponentMediator will respond to the note, so you pass something in the type property of the notification that will allow the two instances of MyComponentMediator to discriminate and only act on notes meant for the right instance. This could be a bit of information shared between MyComponent and MySubComponent, for example.  MyComponentMediator could look at the type property and if it is equal to some property on its view component, then it acts on the note.

I get the point! But this implies a kind of hard coupling between MyComponent and MySubComponent. But I imagine that we don't have any other choice that indicating which Mediator we need at one time or another anyway.

Here is my question to you: is there a good reason for you to build this big mediation loop? Why doesn't MyComponent listen to MySubComponent for the same event, and change its state in the handler? Why go the long way around the barn?

The program I am currently coding is actually a test required by a company to test my knowledges in framework usage. So my interest here was to code it as lose as possible! I admit that this kind of shortcut that you mention is probably smarter in some case like that where components are nested and no command or data exchange is required ::) Your explanations can't be more clear!

Thanks for your post.... number 2581!  :P

8  Announcements and General Discussion / Architecture / RetrieveMediator for multiple instances on: October 18, 2011, 11:49:35
Hi guys

I read almost all the threads concerning the use of multi instances of a same Mediator. There is one thing that I didn't find: how to get back one of these specific mediator? Here is my case:

Architecture (simplified, easier than refectoring some example code):
*MyComponent.as is a component that I need to place 2 instances on my application. It has 2 states normal, and changed. Initial state is normal.
*MySubComponent.as is dynamically created and nested into each MyComponent. It has 1 button.

What I need to achieve:
When I press one of the 2 buttons from MySubComponent objects that are on my stage, the state of the corresponding parent (MyComponent) has to change from normal to changed.

What I've done:
* My ApplicationMediator creates 2 instances of a same MyComponent component + registers the 2 instances of MyComponentMediator using the myComponent.id property to make its name unique.
* Each MyComponent creates its own MySubComponent + registers its MySubComponentMediator.
* When I press the button of any MySubComponent, I send an Event to MySubComponentMediator.
* Here, I need to retrieve the MyComponentMediator associated to the MyComponent parent (and only this one!)in order to alter its state....here is my problem!

Thanks for your input!


Pages: [1]