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] 2
1  PureMVC Manifold / Standard Version / Re: The good logic for command ? on: October 17, 2008, 05:28:09
product and description are 2 differents tables..
2  PureMVC Manifold / Standard Version / Re: The good logic for command ? on: October 17, 2008, 12:08:15
thnaks tek, it was exactly what i'm looking for. Even if it's not a very complex command.

The add logic may be more explicit in this case.

In order to add a product, i've two request to do.

First, register the productVO into product DB. The result event (via amfphp for example) send me back  the productVO with the ID generated by the table.

Then with this ID, i have to register descriptions for product.

Actually i do all this operations in product proxy, that call description proxy on getting result form service.

It's a more complex opération, that the delete example, because i need to wait the first operation finishing before launch the second one.

So, if we imagine a command to do this, we need in fact 2 commands.

First command :

addProduct -> call product proxy (remote service, etc...)

on the back onCreateProduct -> send Notification that call the second command add Descriptions passing the ID product

and finally when onDescriptionAdded calling -> send NOtification to the mediator to tell the adding product loop is ending ?

What do you think about it ?

3  PureMVC Manifold / Standard Version / Re: The good logic for command ? on: October 16, 2008, 12:19:13
ok, i understand.

thanks
4  PureMVC Manifold / Standard Version / Re: The good logic for command ? on: October 16, 2008, 08:05:11
commands are best used in keeping the View from binding directly with the model

sorry, i'm french .

but you mean that you dont use binding ?
5  PureMVC Manifold / Standard Version / Re: The good logic for command ? on: October 16, 2008, 02:18:05
you're right about purity in using command, but in many case it's seems that it's not  necessary to invoke model by controller.

the mediator can do it because he's not the view.

That's what i've seen in many examples.


i 'm searching some complexe example of command, would you have some link ?
6  PureMVC Manifold / Standard Version / The good logic for command ? on: October 16, 2008, 12:51:03
Hello,

As many people before me, i've trouble in understanding when i can talk with proxy directly from mediator and when i 've to use a command.

But this morning, i was trying to implement a logic of deleting product. In fact when i delete a product i've to talk with product_proxy but also with description_product_proxy (another table in db).

So i was beginnning to implement it into the product_proxy but it seems to myself that was not a good solution to invoke description_proxy from product_proxy, so the logical of puremvc push me in thinking about a command where i can invoke product_proxy and all the others proxy i need.

So is it the good way of thinking a command ?

(please, do not tell me to read the doc, i read it all days (holly bible), but there's a difference between read the concept and understanding examples and work with them)

Thanks !
7  PureMVC Manifold / Standard Version / Re: Does mediator sendNotification to proxy or they can call directly ? on: October 02, 2008, 11:53:30
thanks guys...
8  PureMVC Manifold / Standard Version / Re: A view componet can register herself to the facade ? on: October 02, 2008, 11:52:40
thanks
9  PureMVC Manifold / Standard Version / A view componet can register herself to the facade ? on: October 01, 2008, 02:11:18
Hello,

A little question . In my app, i have many component, each one has his mxml file.

So i have the MainView > ViewStack > TabNavigator > ComponentHomeMade

Today,  for register my ComponentHomeMade to the facade i do this inside the component itself :

:
private function registerComponent():void
{
ApplicationFacade.getInstance().registerMediator( new ProduitVOListMediator( this ) );
}

and this is invoked on the addedToStage Event.

It's very usefull to do that (i can unregister it with removeFromStage).

But i'm thinking that it's not very clean, it seems that a view component would not have this responsabilty ?

Am I true or Not ?

Thanks again...
10  PureMVC Manifold / Standard Version / Re: First real project with puremvc : is my plan good ? on: September 27, 2008, 12:14:30
hi,

cool, we are two now  ;D

finally, between front and back the only thing that change is the view (and under flash the connection service )...

i'll report my experiment soon ;)
11  PureMVC Manifold / Standard Version / Re: First real project with puremvc : is my plan good ? on: September 25, 2008, 12:20:55
i was thinking that just values objects can be reuse .


ps : why am i alone in this forum ?  :-*
12  PureMVC Manifold / Standard Version / Re: First real project with puremvc : is my plan good ? on: September 24, 2008, 10:44:18
thanks again Cliff,

Is there's a way to have front end made with flash and back end made with flex ?


13  PureMVC Manifold / Standard Version / First real project with puremvc : is my plan good ? on: September 24, 2008, 01:44:31
Hi,

After playing a little bit with puremvc. I start to planning a real project with it.

The project is an little e-commerce website.

The back offfice is under flex with puremvc

The front office is flash based with puremvc too.

First question : how can i re-use some puremvc code produced for back office to front office (methods for CRUD service for example) ? i mean in a architectural logic ?


Second question :
for the back office i see the thing like that :

2 states :

- 1 state for login operation that use puremvc for requesting database via model and service delegate


- 1 state for admin opération, that display a viewStack.

 Each view of the viewstack :
- use a specific component to display data

- manage one Value Object and use the puremvc logical to do it (CRUD via webservice...)

What are thinking about this plan ? is it a good way ?

Thanks again.
14  PureMVC Manifold / Standard Version / Re: Why my component doesnt dispatch the event ? on: September 24, 2008, 01:20:16
yes !

it's work, after some changes, it work using the popmanager that you show me.

thanks again.
15  PureMVC Manifold / Standard Version / Re: Why my component doesnt dispatch the event ? on: September 24, 2008, 12:27:52
hum, i've in the facade some event that are same string value those in product event ?

conflict ?


:
package com.freddufau.eshop
{
import com.freddufau.eshop.control.command.*;
import com.freddufau.eshop.view.components.MainView;

import org.puremvc.as3.interfaces.IFacade;
import org.puremvc.as3.patterns.facade.Facade;

public class ApplicationFacade extends Facade implements IFacade
{

public static const APP_STARTUP:String = "AppStartUp";
public static const CREATE_PRODUCT:String = "createProduct";
public static const SHOW_CREATE_FORM:String = "showCreateForm";
public static const GET_PRODUCTS:String = "getProducts";
public static const UPDATE_PRODUCT:String = "updateProduct";
public static const DELETE_PRODUCT:String = "deleteProduct";
public static const SELECT_PRODUCT:String = "setProduct";
public static const PRODUCT_DELETED:String = "productDeleted";

public static var MAIN_VIEW:MainView;


public static function getInstance() : ApplicationFacade {

if ( instance == null ) instance = new ApplicationFacade( );

return instance as ApplicationFacade;

}

override protected function initializeController():void
{
super.initializeController();

registerCommand(APP_STARTUP, StartUpCommand);
// Uncomment and replace with the appropriate Commands
//registerCommand(CREATE_PRODUCT, CreateProductCommand);
//registerCommand(GET_PRODUCTS, GetProductsCommand);
//registerCommand(UPDATE_PRODUCT, UpdateProductCommand);
//registerCommand(DELETE_PRODUCT, DeleteProductCommand);


}

public function startup( app:MainView ):void
{
MAIN_VIEW = app;
sendNotification( ApplicationFacade.APP_STARTUP, app ) ;
}

}
}
Pages: [1] 2