Web Programming

WebPro

The World Wide Web is over 20 years old technology and can now be called a fundamental platform for software development. In the early days it was not clear that having a web interface would be the appropriate thing for enterprises. Today, it is the essential form. It is so important that we can consider the web as the default and standard interface to enterprise application, be they for desktop computers or mobile devices. My 10th lecture in my Design and Implementation of software is about Web Programming.

When the web started to gain popularity, mostly with static sites manually edited, most enterprise programs were client-server programs. These programmes were installed on users (employees) machines. Microsoft Windows was in the 90s the most dominant operating system so enterprise software was usually Windows clients that accessed some servers that had access to the database.

Most enterprise developers ignored the web as user interface since it was very primitive and clearly a step back. Each interaction, for example pressing a button on the web page, resulted in sending some request to the web server, generating a new page and sending it back. Compared with native Windows program, responsiveness was horrible for the web. Add to this the general scepticism on security issues.

However, the benefits of the web – its simplicity and universal availability outweigh the drawbacks and slowly people started to use the web as the preferred platform.

First programs were CGI programs. CGI stands for Common Gateway Interface. This allowed web servers to execute programs and use the output of the program as a response to the web browser. CGI could be written in any programming language but Perl became popular, not only because it is flexible and powerful, mostly because it is interpreted and does string manipulations very well.

The first programs that I wrote for the web were C++ programs. In the first versions we simply hardcoded the layout and the HTML within the program. Later we switched to Java and JavaServer Pages. Todays programs are much more complicated. We pages are broken into many components and interactivity has been added with JavaScript. As an example, at Betware we use content management system (CMS) with JavaScript widgets that call REST services in the backend.

All these technologies use very simple and fundamental design pattern that first appeared in the 70s, Model View Controller. The idea is to break user interface components into three distinct roles. The Controller is the entry of the request, and handles the parameters that come with the request. The controller uses the model for the “state” or domain logic, be it calculations or getting some data. The model will deliver some data that needs to be rendered. It is the responsibility of the view to render the user interface.

In the lecture, the Model View Controller (MVC) design pattern is covered and some ways to create the controller and the view.

The lecture can be found here: L10 Web Programming