Quote from: kc64 at Apr 26, 2010, 11:44 AM
What is the best way to develop ExtJS back-end code?
Are there MODx API functions (in Evo or Revo) to support ExtJS apps that require data stores, etc?
First off, I recommend you read on Custom Manager Pages (CMPs):
http://svn.modxcms.com/docs/display/revolution/Custom+Manager+Pages
Then, MODx uses a wrapper around ExtJS we call "MODExt":
http://svn.modxcms.com/docs/display/revolution/MODExt
It can be used to provide connectivity to processors, which would power your ExtJS-based CMPs.
When I needed database access in my app, I used MODx DBAPI. When I need an ExtJS data store to populate a tree or grid, is there a MODx Ext API library that can help or should I write my own functions?
You should take a look at Quip, or Gallery, or any of the other Extras that have their own CMPs. They detail how this can be done.
That said, you are free to do it however you want.
I’m also wondering what are the best-practices for back-end coding. Should I write my PHP functions as methods in a application-related code module? Should I treat data source handlers as static methods and call with $obj::method rather than $obj->method?
You should use xPDO and take advantage of processors.
In an AJAX application, when does the session expire such that the instances of classes are destroyed? My guess is that the instances will persist until all AJAX requests terminate. Is this correct?
Incorrect - ajax requests are asynchronous and non-persistent. So if you instantiate a connection to the server with an AJAX request, it runs the PHP script, and then feeds back the output, just like a normal PHP page.