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

Pages: [1]
Print
Author Topic: My last confusions DATA  (Read 6232 times)
Vander
Full Member
***
Posts: 32


View Profile Email
« on: April 19, 2008, 04:56:35 »

okay...
i will try to start integrate amfphp remoting on it...
then some questions made me lost...

1. still confused where is the place to initialize a new VO()... in a view ADD command for example? only if it dont passes value? in the SUPER inside proxy constructor? and why i see in examples the second argument of super, being an array for example, or even in the constructor header? im lost! hehe

2. i think i must build a business delegate to connect with amfphp... so business delegate its only a connector? with all that asynctoken stuff that i really did not fully understand.... or business delegate also is a place of 'common methods' i saw in a example some add, update, delete, on business delegate... strange.. i was thinking that business delegate just connect and other things is managed by the proxy... so business delegate can be a common place for common proxy tasks that can be reused? o.O

3. as i said im trying to start using amfphp... ive step debugged and i feel strange that it seems just passing through constructor before registering the proxy.. i dunno... feel strange the sequence that the application runs.. in step.. seems somelike backward o.O... i need a little help where to put the things... and sometimes i saw a xml file like service config something like that... where put some uri stuff (endpoint) to amfphp.. but i also read that its not necessary and can be done via actionscript...

someone SAVE-ME! o.O
im LOOOOOOOOOOST hehe

thanks everyone
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: April 19, 2008, 07:40:04 »

1. still confused where is the place to initialize a new VO()... in a view ADD command for example? only if it dont passes value? in the SUPER inside proxy constructor?
This totally depends on your situation.

You might be creating a VO in a view component and initializing it so it's properties can be bound to by form components like text fields when the app is created. But later that VO property might be replaced by a Mediator who takes a VO returned from a service and sent inside a Notification to the Mediator, causing the retrieved data to flow by binding from the new VO placed on the view component.

Or you might have a Proxy who creates the VO and is later retrieved and the VO manipulated.

You might create the VO in a Command and pass it on the constructor of the Proxy that will maintain it, or you might create that VO in the constructor of said Proxy instead.

Any of these are OK. You just have to get a handle on when things happen and in what order, so that you know where the most appropriate place to do something is.

and why i see in examples the second argument of super, being an array for example, or even in the constructor header?
The Proxy class takes name and data as args. The second argument is often created on the spot at construction time, so that the data property is not null, in case any other actor should attempt to manipulate the data. Later it may be replaced by a return from service.

i think i must build a business delegate to connect with amfphp... so business delegate its only a connector?
You only need the delegate if more than one proxy will talk to the service. If only one Proxy talks to a service, then feel free to encapsulate the service within the Proxy.

ive step debugged and i feel strange that it seems just passing through constructor before registering the proxy.. i dunno... feel strange the sequence that the application runs..

I'm assuming you see code like this:

:
facade.registerProxy(new MyProxy());
Though the registerProxy may be the first thing you see left to right, the Proxy must be constructed before it can be registered, and so the MyProxy constructor is executed, returning the MyProxy instance, which can then be registered. This has nothing to do with PureMVC, this is just the way the language works.

For clearing up your confusion about PureMVC related issues, I would highly suggest that you read the Best Practices document. It can really help.


-=Cliff>


« Last Edit: April 19, 2008, 07:43:19 by puremvc » Logged
Pages: [1]
Print