PDA

View Full Version : Understanding DirectStore and Proxy


KGeiger
07-10-2009, 01:23 PM
Hi All,

I would appreciate any input. I have tested Evan's .Net Direct examples and Shibu's examples and I have been both working. However, I see that in Shibu's example he used DirectStore and I am trying to understand the purpose of DirectStore? What are some of the benefits, because I am thinking I could use a regular store why do I need to use a DirectStore? The other thing is I tried to use a DirectStore with Evan's example but for some reason it is not going into the function I specified using directFn in the config of the store and I tried this other configuration api: {load: <functionName> } but that still did not work. So in addition to trying to understand the pros and cons to DirectStore, I am also trying to understand the difference between using DirectProvider and DirectProxy that Shibu has included in his example (thinking that this maybe the source of my problem). I have also noticed that the ExtDirect Pack that we can download from extjs doesn't have DirectProxy and uses DirectProvider, which is fine, I am just trying to wrap my head around the differences and the pros and cons. I would appreciate any feedback.

Thanks!

KGeiger
07-10-2009, 03:22 PM
Ok, I got the problem working now but I would still like to understand the benefits of using DirectStore vs any other store. The more I look at the code and try different things I believe the DirectProxy and the DirectProvider essentially does the same things just different ways of implementation.

aconran
07-10-2009, 10:47 PM
KGeiger -

DirectStore is simply a convenience class of Ext.data.Store which predefines that you will be using a DirectProxy and a JsonReader. You could manually setup a plain old Ext.data.Store with a DirectProxy and a JsonReader and have exactly the same effect!

Other convenience stores are:
- ArrayStore - which assumes a MemoryProxy and an ArrayReader
- JsonStore - which assumes an HttpProxy and a JsonReader

KGeiger
07-13-2009, 09:25 AM
I see, it makes sense now! I just wanted to make sure I wasn't overlooking something significant. Thanks aconran.