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 / Re: the role of the singleton in puremvc on: February 07, 2008, 03:52:37
I think there was a misunderstanding about the way we implemented:
# Flex modules have unique behavior compared to separate flash swfs:
- When you need optmization, they must run in the same context, so they can share classes.
- It's impossible to use "sub mvc's". When a singleton is created in flex, the next instances will return the first loaded instance, even if its in a separate module (when using optimized modules and  runing in the same context/appDomain)
Ps.: If you disable module optimization you'll have to embed the flex framework classes in each module.

I totally agree with fleecie. The main idea was:
Create a AbstractFacade and Facade extends AbstractFacade and implements the singleton (default usage)
When you need to use it in flex modules, your applicationFacade wil extend AbstractFacade and not Facade. You'll have to implement the singleton pattern too (to have one instance per module).

That's all you have to do (if there were no dependencies on singletons).

As Cliff has sad, changing the framework default implementation is out of the question, so whe had to change the aproach.

2  Announcements and General Discussion / General Discussion / Re: PureMVC without singleton's? on: February 06, 2008, 06:03:43
It was made specially for modules because there is a high dependency on singletons and we can't change the framework source.
If there were no singletons, we could use the applicationFacade, Mediator, proxys...etc... without any changes, and it would work in Flex and Flash. Because we can't change the source, the only solution (and I agree that's strange) was changing constant names for modules.
tks
3  Announcements and General Discussion / General Discussion / Re: PureMVC without singleton's? on: February 06, 2008, 07:19:52
Take a look at this post:
http://forums.puremvc.org/index.php?topic=199.0

We had the same problem working with modules in Flex.
4  Announcements and General Discussion / General Discussion / Re: Modular Applications with PureMVC on: January 11, 2008, 07:45:49
Hey Aridany, thanks for the tip.

I read all posts related to modules, but we couldn't find a solution for optimized modules in different projects (using same appDomain to share classes and decrease file size).

Changing the registration names was our first attempt (it really works), but it's not a reliable solution when you have to use third-party components (softwarehouses or when you don’t have access to the code).

There are some issues changing registration names:
  • Two different components sharing the same registration, proxy and note names (without source)
  • Creating instance UIDs will crash collaborative applications (record, transmit and replay) because it will be impossible to notify a "remote/local proxy" instance (eg.: record user interaction; save notifications; replay notifications in another application instance)

It sounds like criticism but it’s not. We’re massively using this awesome framework, but we’re facing some problems that are demanding framework changes and we don’t want to do that.

Hope we could find a nice solution.
Thanks
5  Announcements and General Discussion / Architecture / How to use Singleton Facade in Modular Applications on: January 04, 2008, 06:02:38
Hi Cliff,

We're trying to use PureMVC in a modular application and we couldn’t use the default implementation of Façade.
That´s the scenario:
MainProject (using PureMVC)
Module1 (using PureMVC)
Module2 (using PureMVC)
*Each module and the MainProject were implemented in separate projects

The Problem:
When you try to access the Façade implementation of any Module (each module has its own implementation that extends from Façade) the system returns the MainProject instance.
We’ve created our own Abstract Façade (copy default Façade code and remove the singleton behavior), turning it in a non-singleton class. The Singleton behavior is now living in the concrete implementation.

It seems to work, and we could use PureMVC inside modules successfully.
We tested other possibilities, but that’s the only one that worked. What do you think about it? Is there any other way to do that without changing the framework?

Thanks in advance,
Diego Volpe and Rodrigo
6  Announcements and General Discussion / General Discussion / Re: Mediators Sequence/Priority on: September 11, 2007, 08:53:42
Hey Cliff,

You're absolutely right. The observerMap lives in the view.
I think your suggestion is much more consistent and less intrusive (the Mediator itself holds the filter logic). Thanks.

The classes I've mentioned before are just the tip of the iceberg. We have a working Flex "Class Builder", a sort of online Powerpoint integrated with a huge multimedia database (videos, animations, simulators, etc).
The Educational Company I've been working for wouldn't allow me to share the code, but I'll try to setup some "generic" examples demonstrating how PureMVC and other useful patterns were used.

I have other questions like instance Mediators using UIID, ProxyFactory combined with Inversion of Control, ChainCommands simulating workflow, TypedServices combined with Proxys, and so on, but I'll mature these doubts before starting a discussion.

Thanks again.
7  Announcements and General Discussion / General Discussion / Mediators Sequence/Priority on: September 11, 2007, 02:16:35
Cliff,

Firstly, congrats on sharing this excellent project.

I need to enable/disable mediators without using register/remove in order to keep their creation sequence/priority.
The mediators must work much like interceptors, keeping their sequence (data and transformation dependency)
Imagine the following scenario: I have 3 Mediators, registered to the same view, to Analyze, Record and Broadcast user interactions:
1) GestureAnalyzerMediator
2) GestureRecorderMediator
3) GestureBroadcasterMediator

How can I disable/enable only the GestureRecorderMediator without using removeMediator/registerMediator?
Is there a different approach to keep the registered priority/sequence using those methods? (How about override facade.notifyObservers in order to filter the notifications to the mediators that are flagged to enable)

Thanks.
Pages: [1]