PDA

View Full Version : Why i should use Ext Direct



wallynm
17 Nov 2011, 5:02 PM
Hello guys, i'm starting to develop with Extjs, and i was thinking on use Ext Direct to make all the calls from the system. I had read a little about it, some content from Sencha, but i can't understand why shou be an nice idea use it on my project...

Recently, i'm using Ajax calls... If someone could help me showing some good points... Thanks!

vadimv
18 Nov 2011, 12:11 AM
less code, less maintenance, and less bugs, separation of logic, nice simplified client to server communication. No need to set request info like urls and other stuff, just call the method. Also is nice for polling an address periodically, I used it and liked very much.

wallynm
18 Nov 2011, 4:16 AM
less code, less maintenance, and less bugs, separation of logic, nice simplified client to server communication. No need to set request info like urls and other stuff, just call the method. Also is nice for polling an address periodically, I used it and liked very much.

Today i'm using Codeigniter at the server side (it is MVC based), and I think the Ext Direct not add anything in.
Example:

I have an class named Tasks, and it has an method getData(), that echoes on the browser the JSON Data stored on the database, with Ext Direct, i would need to set the Taks.getData() to get the JSON (i never tryed it, maybe i'm wrong), with pure PHP i would need to pass some variables to an page via POST or GET to specify what class and method i would need to access... This way, could be an terrible way.

With Codeigniter, when an class are declared as Controller, you can acces each method from the url, so, my Task example task could be accessed like this:
yoururl.com/Task/getMethod

My problem to understand why use Ext Direct its because Codeigniter make access to methods through url's really easy, as Ext Direct.... Also, if i try Ext Direct, i will need to keep using Stores, so i can't see less code on it...

vadimv
18 Nov 2011, 5:37 AM
I haven't used direct with stores, but looking at .DirectStore it seems that is almost just like any .Store, probably here "less code" is not so visible. I've used direct for ajax requests, and there was for sure less code.

wallynm
18 Nov 2011, 5:39 AM
I haven't used direct with stores, but looking at .DirectStore it seems that is almost just like any .Store, probably here "less code" is not so visible. I've used direct for ajax requests, and there was for sure less code.

Using Ext direct i don't need to create stores to work with the server data?

vadimv
18 Nov 2011, 5:43 AM
for grids and dataviews you need stores.

wallynm
18 Nov 2011, 6:02 AM
for grids and dataviews you need stores.
I saw some examples using stores with checkboxes, it uses stores too with Ext Direct?