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 / Architecture / Re: MacroCommand on: February 20, 2008, 02:59:30
Ok ok...

Thank you very mych.
2  Announcements and General Discussion / Architecture / MacroCommand on: February 19, 2008, 04:54:17
Hi,

A MacroCommand dispatches its Notification to all of its sub commands.
But how could we dispatch only an identified part of the body to a particular sub command ?

Exemple :

MyMacroCommand receives [A, B, C] as body of its Notification.
We would like that subCommand1 deals with A, subCommand2 with A and B and subCommand3 with A and C.

(These 3 sub commands are used independently elsewhere in the App...)

Thanks, in advance...

Mo&Th
3  Announcements and General Discussion / Architecture / Re: Communication between a particular Proxy and a particular Mediator on: February 14, 2008, 03:12:57
OK, if it's the good practice, I'll do it in this way.

Thanks again.

PS : my attachment is just a picture with arrows connecting M and P. And "Blip" is just my favorite french placeholder...
4  Announcements and General Discussion / Architecture / Re: Communication between a particular Proxy and a particular Mediator on: February 13, 2008, 11:45:20
Thanks Cliff.

Oups... I omitted to read this thread before posting : http://forums.puremvc.org/index.php?topic=231.0, sorry.

But since we're going into this topic again, can you explain why C is it the best answer ? As 'type' must be a String, we'll probably pass something like a name, so is it very different from B ? We have to give a very strong importance to our objects naming policy... An equality test between two Proxies references couldn't be more 'robust' ?
5  Announcements and General Discussion / Architecture / Communication between a particular Proxy and a particular Mediator on: February 13, 2008, 07:03:44
Hi,

I have the following case :

[ Please have a look on MP.jpg ]

2 instances of the BlipProxy class, and 4 instances of the BlipMediator class.
An arrow from Mx to Px means that Mx retrieves Px to work with.

My question :

When BlipProxy2 is updated, a notification is sent. The four mediators will receive it, but only BlipMediator4 will have to update its view component. bM1, bM2 and bM3 mustn't react.
What is the best way to do this :

A. Every mediator keeps a reference to his frequently used Proxy (private var _blipProxy). When a BlipProxy sends a notification, he puts a reference to its instance in the body. Then, when the notification is handled by the BlipMediator, the body has to be equal to this._blipProxy.

or :

B. Give the same name to blipProxy2 and blipMediator4. The BlipMediator notification handler will check their identity to know if something must be done.

or :

C. Maybe use the "type" parameters in Notifications... but is it really a "type" ?

I can't see which is better ...

Any idea ? Thank you very much...
6  Announcements and General Discussion / Getting Started / Re: Proxies, VO and a classic tree structure on: February 11, 2008, 04:51:59
The role of Proxies / VO in such a Client/Server architecture is now perfectly clear to me.

But I must admit that I'm a bit desoritentated if we now consider the Data Model of a RDA with only local data, like a multimedia creation tool or a classic single player game (data are destined to stay 'in' the app, on the local drive; no share, no distant access, no XML marshalling, etc.).

For example, let's assume the case of an audio segmenting and annotation tool. In the Data Model, we'll have something like an 'AudioSegment.as'. These sound fragments can be annotated, played, stopped, associated to other objects (pictures, lists of KeyWords, etc.)...
We have AS objects that has been designed for previous apps. For exemple, there is something like :
:
public class AudioSegment
{
    private var _sound:Sound;
    private var _annotations:ArrayCollection; // Collection of various objects of the Data Model
    (...)

    public function AudioSegment(url:URLRequest){
        this._sound.load(url);
        this._sound.addEventListener(Event.COMPLETE ...
        (...)
    }

    function play / stop (...)
    function getAnnotationsList (...)

    (...)
}
Where do we have to put instance methods ? I'm afraid I'm not able to properly understand how will the PureMVC Data Model look like...

Your answer will be more than precious to me...

Thanks, in advance.
7  Announcements and General Discussion / Getting Started / Re: Proxies, VO and a classic tree structure on: February 10, 2008, 12:11:39
1. Thanks Cliff, I don't need to worry any more with the creation of hundreds of proxies... The lack of PureMVC examples which use this kind of practices made me wonder whether it could be an "acceptable" method.

2. In fact, a close colleague, with a strong 'classic' C++ background, was a bit reticent to split attributes and methods between two different classes. As we are working on a very big local app (neither network nor database), I'd like to be 100% sure to understand and master the underlying logic of PureMVC model organisation (whose examples focus on internet apps, with DB).

Thanks again, for the time you devoted to answer, and for the clarity of your explanations.
8  Announcements and General Discussion / Getting Started / Re: Proxies, VO and a classic tree structure on: February 09, 2008, 12:58:39
OK, thank you. The choice seems clear for me now.

But something still surprises me.
If all the data are stored into a single collection, a classic NodeProxy method like 'suppressNode' (which plugs the children of a node to its parent, disconnect it, and then, suppress it), would be invoked with :

aNodeProxy.suppressNode(noteToSuppress);
instead of something like :
noteToSuppress.suppressNode();

Hum. Maybe my questions could seem stupid... but :

1. The use of a single Proxy to keep track of data seems to be a 'distortion' of the Object Oriented way of programming... ???
2. And more generally, when we start a PureMVC local app and have to translate existing classes, do we always put attributes in VOs and methods in Proxies ?
9  Announcements and General Discussion / Getting Started / Re: Proxies, VO and a classic tree structure on: February 08, 2008, 04:06:05
Thank you very much for your answer, that implies another question...
Does the single NodeProxy manage all the Node objects of the application, or do we have one NodeProxy for every tree that has been built ?
For example... Let's assume that users can create a new tree by selecting and copying a node in a tree structure (the copied node's _parent attribute is then set to null, because it becomes a new root). We now have a second tree, which is a subset of the first one. Can it claim to have its own NodeProxy ?
So, in such a case, which granularity for the Proxies creation policy ?

Thank you, in advance.
10  Announcements and General Discussion / Getting Started / Proxies, VO and a classic tree structure on: February 08, 2008, 10:14:28
Hello,

I am a beginner with the PureMVC framework, and I don't exactly know how to translate my data model in Proxies and VO... I'd like to manipulate a tree data structure, where every Node :
- is associated to an object (to store data),
- owns a list of all its children (an ArrayCollection of Node).
It must be something like this :

Node.as
public class Node
{
   private var _name:String;
   private var _object:Object;
   private var _children:ArrayCollection; // list of Node
   
   public function Node(name:String, object:Object):void{
      this._name = name;
      this._object = object;
      this._children = new ArrayCollection();
   }
   // getters & setters ...
}

Is it the right way to do, if I :
- create a VO with the code of the Node.as class,
- create a NodeProxy for every new Node (which means that Proxies are dynamically created, and identified by a unique name that could be their associated Node's name),
- put methods like 'calculateDepth', 'getAllDescendants', or all the classic tree-manipulation operations, in the Proxy ?

Or maybe have I misunderstood something ?

And : would it be a problem if I decide to not use VO, but put Node's properties directly in the Proxy ?

Thank you very much for your help.

Thomas

PS : I apologize for the poor quality of my english...
Pages: [1]