I would like to start small discussion about some 'pattern' related with 
management of data from database in
flex. All examples that I`ve found in the web shows only some simple cases, 
and I haven`t found description of some complex problems.

So for this example, let`s suppose a very simple class model like this:

class Company {
  var id:Number;
  var name:String;
}

class Order {
  var id:Number;
  var order_items:Array;
  var company:Company;
}

class OrderItem{
 var id:Number;
 var product:Product;
 var number:Number;
}

class Product{
  var id:Number;
  var name:String;
}


So we will try tu build an application that will allow to browse throught 
orders, and to add some new one.
Also we want to be able to add/modify/remove Company and Product 
dictionary.
Let`s suppose that we will get data through AMF, and use Cairngorm.

First thing after application start will be sending a request to receive 
all data from server
So we will send some requests like LIST_PRODUCTS, LIST_COMPANYS, 
LIST_ORDERS

While the first two will send us back simple array of objects, the third 
one should send array or <Order>
objects, with it`s related attributes 'included' - like array of 
order_items, and related <Company> object.
order_items will be an array of <OrderItem> class, and each one will have 
related <Product> class

Now we would like to make a window to add/modify order, where company will 
be placed in ComboBox field.
Dataprovider for this ComboBox will be a <Company> objects array.
If we will simply try to assign its value to order.company value, it won`t 
work because of course these are
different objects. That`s the firs problem.

Lets now suppose that we will modify some product in products array, 
(change it`s name) and save it.
Of course products in order items won`t magically change, because they are 
different objects and we need to do it our selfs.

So my main question is - How all this case should be realized. How should 
we write some bigger application, that needs to 'recreate' some part of 
RELATIONAL database in the client side.
I know that it can be done in many ways, but for example - sending data to 
a client with foreign keys id`s ( company_id:Number) and then linking it 
back at the server side is really primitive way.

How do you realize your`s application in a subject od relational data 
management ?
Maybe some Adobe expert will write few words about 'How it should be done' 
?

Best Regards


------------------------------------

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to