PDA

View Full Version : Advice on structuring a large ExtJS application



srn
19 Feb 2010, 12:03 PM
So I'm pretty new to ExtJS development, and I'm building a fairly large application (use your imagination to determine what that means).

I want to do it "right" the first time. I have seen Douglas Crockford's examples on how to design to the Singleton pattern, which allows JavaScript to facilitate private/public properties/methods, and this is the way I started building my application.

I have also read Saki's Blog which says how to structure a "big" application, which uses a seemingly different technique.
http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/

Does anyone have any input on what works best with ExtJS? There are so many ways to write JavaScript, it almost seems like figuring out the "correct" way is like untangling a huge mess of wires!

Many thanks!

-srn

evant
19 Feb 2010, 9:16 PM
Obviously there are no hard and fast rules, the best thing to follow is to do whatever makes sense.

A singleton entry point is often useful, just because you can kick off your app from there (like a void main()). Using the singleton pattern to control access to methods isn't overly useful, you can see that Ext doesn't do this for "private" methods in classes, they are just marked as private, or not included in the documentation.

Seperate your classes into files, then just build it lik eany other OO project!

srn
22 Feb 2010, 12:34 PM
I guess I'm still trying to figure out what makes sense, as this is my first application. i.e. what first steps to take.

Demos and all that are great, but it would be nice if there was a blog entry kicking around about what you should definitely DO, and things you should definitely AVOID in an Ext JS application.

Or maybe something like a "10 first steps every Ext JS developer should know" kind of thing kicking around :P I know there are no hard and fast rules, but maybe some handy best practices? :D