Developing highly scalable and maintainable applications
The following are the factors that we should consider to make highly scalable and maintainable web applications that rely heavily on JavaScript.
Modularization
With big applications, writing everything in a single JavaScript file is not a good practice. Nonetheless, even if you have separate JavaScript files for different modules and referencing them through the scripting <script>
tag bloats the global namespace. A proper structuring should be done to keep JavaScript files into separate module-wise folders. For example, an ERP application consists of several modules. We can create separate folders for each module and use specific JavaScript files to provide certain functionality for specific views or pages. However, the common files can reside in the common folder.
Here is the sample project structuring to arrange JavaScript files based on an ERP module. Each module has a service
folder that contains some files to do some read or...