Architecture of a single-page JavaScript web application?

后端 未结 14 1501
迷失自我
迷失自我 2020-12-07 06:36

How should a complex single-page JS web application be structured on the client-side? Specifically I\'m curious about how to cleanly structure the application in terms of it

14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 07:31

    The way I build apps:

    • ExtJS framework, single page app, every component defined in a separate JS file, loaded on-demand
    • Every component contacts its own dedicated web service (sometimes more than one), fetching data into ExtJS stores or special-purpose data structures
    • The rendering uses standard ExtJS components, so I can bind stores to grids, load forms from records, ...

    Just choose a javascript framework, and follow its best practices. My favorites are ExtJS and GWT, but YMMV.

    Do NOT roll your own solution for this. The effort required to duplicate what modern javascript frameworks do is too big. It is always faster to adapt something existing than to build it all from scratch.

提交回复
热议问题