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 / General Discussion / Handling CRUD operations with RemoteObjects on large amount of data on: April 03, 2008, 03:32:26

   I can say that this is not strictly oriented to PureMVC but since I am using it it has some relations.
I am interested in the way you handle data changes for the records that is acquired from the database with a lot of records.
For instance lets say that you are working with 10 000 records (ok there can be paging but still you want to display at least 1000 records in a DataGrid).

Proxy is responsible for comunication with the database backend and operations on the data.
Considering memory consumption it is good to bind Proxy.data to the ArrayCollection which is used as a dataProvider for a DataGrid. When user makes some change in that list, proxy has to send the request to the database to execute the operation.
When the operation is successful, there are 2 approaches that I am considering:
 - reload the data again form the database - for a lot of records it can be slow
 - or change the data directly in actionscript

with the first approach if user scrolled down to watch some records he will lose its position. With the second approach it is better for the user but it requires a lot more work.
For example, on insert service has to send back newly inserted object which can be added to the Array. On update, service has to send updated object back again and then you have to search through the array for the primary key of the updated object and replace it with the new one. Similar thing happens when object is deleted.
I am interested in the best way to handle this, so I want to hear what is your experience?
Maybe better way to store objects in HashMap?
2  Announcements and General Discussion / Architecture / RPC calls handling reponses and IOC on: March 07, 2008, 02:28:08
Hello all,

   I am building big application that has many modules and has very heavy database interaction. Application server is Java and for the front end Flex is used with PureMVC. I wanted to discuss about best practices in handling rpc calls. There are a lot ways to manage this but I will present ones that I consider good:
  1. BusinessDelegate that represents the DAO class. This Business delegate is then used in a Command to execute some of the DAO operations (eg. insert, delete, update). Mediators send notification when user requests operations. Every command is a Responder and sends notifications when rcp op is complete which mediator listens for.
     Good thing: this way it is easy to make different BusinessDelegates (WebService, HTTPService, RemoteObject) and provide it to the command
     Bad: there are a lot of Commands
  2. Proxy represents DAO class. Mediator calls the method in proxy as it would call DAO method and listens for notification that proxy will return.
     Good: very clean
     Bad: nothing special

So I am going with the second approach as I consider it better. Do you have some other ways of handling these?
I have here a so called issue if multiple mediators use the same Proxy class and they all get updated when Notification is returned. I consider this a good thing because this way the view is staying consistent and I didn't find a case when this is unwanted. But if in some case this is unwanted, all of the public methods of Proxy return the AsyncToken, so in mediator it is possible to add custom responder.

The other thing is some IOC framework that I require here. It would be great to easy (configurable through xml, or some other ways like in spring) provide to Proxy some other way of accessing the data (remoteobject, webservice, etc). So did anyone used some ioc container with puremvc?
Pages: [1]