HTML Dog
Skip to navigation

JS Apps

These days JavaScript is being used to build large-scale web applications and the web is maturing as a platform for doing so. These apps have the advantage of being able to be highly interactive and responsive, requiring fewer page loads and HTTP requests.

Ideas are being taken from the software engineering world on how to build such applications, so here’s a few ideas on how to do it before a look at some JavaScript frameworks designed to assist building larger apps.

Modularity

A key concept in software engineering is the idea of modularity in code. Separating out the key functionality of your app improves its maintainability and has a number of development advantages.

For example, in a modular system a component can be swapped out at little cost, so long as the interface between the components remains the same. Similarly, different components can be worked on in isolation from each other, which is beneficial for development time and human resource management.

Modules can be connected in a number of different ways - one way is with modules communicating only with a central event and resource management module, sometimes referred to as a sandbox, and not communicating directly with each other. A module can publish a notification about an event occurring without caring who or what else will act on it. This means that if one component ceases to function the others may continue, and that a new module can be easily added without affecting the others.

MVC Architecture

Model-View-Controller (MVC) architecture is a way of structuring code within an application. A model is concerned with the data in your app; the view with displaying or outputting data and the controller with the business logic and coordinating the models and views. An app might have many of all three.

For example, you might have a User model that is responsible for retrieving information about a user. Then you’d have a Login controller that managed when to show a log-in screen to a visitor. The LoginView would be responsible for showing the screen and handling form submission, the data from which would be passed to the Login controller through to the User model.