2

I am developing a extjs application, and I am just a starter.

It's quite different develop mode for me, and I feel puzzled.

My first question is about client-end architecture, I'm developing a little app now, so I wrote all js codes in only one html file, what if I need to develop a huge app? like this: [Article Manage(leaf in tree)] -> [CURD List(Data Grid)] -> [Edit Article(Dialog Box)]

There will be lot of leaf in my tree, so there are many XXX Manage.

What should I manage my client-end js files(file structure or something else), and how to load these files dynamically? Is there any exists demo?

um.. maybe what I really want to ask is:

How to put my code for every module into different js files and 'include' the dynamically?


I've got the answer, just use loader property of a container component, this method fit me well. Thanks to all of you.

2 Answers 2

2

There are no patterns set in stone, but here's one way to Write a Big Application in Ext 3.x.

Another good resource for ideas, generic to JavaScript, is Nicholas Zakas's video on Scalable JavaScript Application Architecture on YUI Theater.

In my mind the big things to do are:

  1. Write standalone components (think: UI container, data structure, etc) with no dependencies to other components on the page.
  2. When you want to two components to interact, have their parent container wire them together.
  3. Have some kind of logical directory structure for development (doesn't matter what exactly), splitting out each of your "components" into its own file -- even if you plan on combining them into a single file for deployment.
1
  • 1
    I wouldn't put too much weight into an architecture article about Ext 3. Ext 4 changed to a MVC architecture for easier application development, and for any new Ext app I would go with Ext 4 rather than 3
    – KallDrexx
    Aug 5, 2011 at 15:34
0

Not sure if I correctly understood your question, but I'll try to answer. For bigger applications use MVC pattern which allows you to split your application to components such as Stores, Controllers, Views etc. Then you can easily send data from server in JSON for example (using server-side technologies - php, java,...) and read it by Stores proxy. If you look into Samples & Demos they're also loading some bigger structures using php script which returns JSON.

1
  • Thanks for answering.I know how to exchange data between B/S using json, but if without data, UI&logic code are still very huge. MVC seems solve the problem, but before Ext4, how do Ext developers solve the problem? Aug 5, 2011 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.