Heya,

 

I was looking for one too and there doesn't seem to be one.  I'm able to
currently encapsulate Create/Read/Delete actions in commands, but I
haven't yet found a reliable way to encapsulate Updates in a command.
Everything else works very nicely.

 

 

Example of fill:

 

var ev:ProductEvent = new ProductEvent(ProductEvent.FIND_ALL);

      ev.collection = model.products;

 

CairngormEventDispatcher.getInstance().dispatchEvent(ev);

 

Execute:

public function execute(event:CairngormEvent):void {

      var ds:DataSource = new DataSource("productHome");

      var ev:ProductEvent = event as ProductEvent;

 

      ds.fill(ev.collection); // event is carrying a reference to an
arbitrary collection contained in your model

}

 

 

Example of createItem:

 

var ev:ProductEvent = new ProductEvent(ProductEvent.INSERT);

      ev.product = someProduct;

 

CairngormEventDispatcher.getInstance().dispatchEvent(ev);

 

Execute:

public function execute(event:CairngormEvent):void {

      var ds:DataSource = new DataSource("productHome");

      var ev:ProductEvent = event as ProductEvent;

 

      ds.createItem(ev.product); // event is carrying a reference to a
product bean

}

 

 

 

 

Example of deleteItem:

 

var ev:ProductEvent = new ProductEvent(ProductEvent.DELETE);

      ev.product = someProduct;

 

CairngormEventDispatcher.getInstance().dispatchEvent(ev);

 

Execute:

public function execute(event:CairngormEvent):void {

      var ds:DataSource = new DataSource("productHome");

      var ev:ProductEvent = event as ProductEvent;

 

      ds.deleteItem(ev.product); // event is carrying a reference to a
product bean

}

 

 

When you find a good way to handle updates, you let me know ;)
Currently there is no fine-grained approach to updating only one
specific record manually, which kinda sucks.

 

Jay Proulx

[EMAIL PROTECTED]

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of auddaraj
Sent: February 26, 2007 2:54 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Cairngorm FDS Sample

 

Hi,
We are planning to use Cairngorm in our flex project which uses FDS. I 
tried looking around for samples that use FDS(not remoting) but no 
luck. From www.cairngormdocs.org I am able to find number of sample 
that use webservices, remoting etc..

Can anyone suggest a sample Cairngorm app that uses FDS(Data 
services). I am trying to see how FDS methods like fill etc. fit into 
cairngorm model

Thanks,
ANAND.

 

Reply via email to