PDA

View Full Version : Store vs Proxy



mikih
11 Jan 2011, 9:05 AM
Hi folks,

I am designing my first sencha app and put a lot of thinking into architecture... I am a long time dev with e.g. rails or grails.

I am asking myself if its better to create proxies that hold service data for corresponding Models or stores?


What you guys prefer?


Thanks

Flo

AndreaCammarata
11 Jan 2011, 11:29 AM
Hi folks,

I am designing my first sencha app and put a lot of thinking into architecture... I am a long time dev with e.g. rails or grails.

I am asking myself if its better to create proxies that hold service data for corresponding Models or stores?


What you guys prefer?


Thanks

Flo

Hi mikih.
I read you an extract of the official Sencha docs.

"Proxies are used by Stores to handle the loading and saving of Model data. Usually developers will not need to create or interact with proxies directly."

I think this is exactly what you want to know.
To store data you have to create stores.

Hope this helps.

mitchellsimoens
11 Jan 2011, 3:01 PM
However, if you look in the docs for Model, you can see in an example of using Proxies in a Model. It has it's use cases. Basically, if you need to manager more than 1 Model, use a Store. If you only need to CRUD with just one Model, you can then use a Proxy on the Model.