The Main Module and Controllers
In traditional PHP, ASP, JSP, Ruby, or other web applications, direct calls are made to many different full pages. Each page is an entity unto itself. It behaves in a distinct and independent fashion. The main procedural module found in the preceding section doesn’t behave like this at all since it is a Front Controller.
A Front Controller is the door through which all interaction with the application occurs. Each request sent to the application arrives there with the information required to process the request. Since AJAX is a very request-driven approach, a Front Controller is ideal for the back end. If it is written well, its slimness is surprising, as in the example in the preceding section. It requires almost ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access