home 
 
 
 
nlfr
 
Home
About ABIS
Services
Courses
Resources
Contact
MyABIS
C
What is available?ABIS Infor » 2017-09 » 2017-01 » 2016-11 » 2016-06 » 2016-04 » 2016-02 » A New Home for ABIS Leuven » Free & Open Source Software » Angular JS » 2015-03 » 2014-03 » 2013-04 » 2013-01 » 2012-10 » 2012-06 » 2012-04 » 2012-01 » 2011-11 » 2011-10 » 2011-08 » 2011-06Exploring Db2Presentations and papersTest your knowledge 

ABIS Infor - 2016-02

Angular JS

Gie Indesteege (ABIS) - February 26th 2016

Abstract

The internet application world is evolving at fast speed. In the early 90ties only static content, defined via basic HTML pages, was possible. Each hyperlink request transferred a new page to the user. Adding more dynamic features started with the advent of Java applets, and later on with the support of JavaScript. Actual web applications are built on frameworks that support asynchronous interaction between client and server, using a lot of technologies. One of them is called Angular JS.

From static to dynamic web pages

When you want to add more dynamic capabilities to your web site, you can choose for a client based solution. This means that you are going to enhance the static HTML with dynamic features, that are interpreted by the local web browser (Firefox, Chrome, Internet Explorer, Safari, ...).

For example, JavaScript allows for a nice pop-up message, if you click on the corresponding widget:

	<button onclick="sayHello()">OK?</button>
	<script>
	function sayHello() {
	    window.alert("Welcome to JavaScript");
	}
	</script>

JavaScript will be driven by a JavaScript engine, started up in the browser, and controlling the local page 'presentation'.

The writing of JavaScript can be enhanced by means of so called JavaScript libraries, that add nice functionalities in an easy way. Well known examples of libraries include JQuery, Dojo, or VelocityJS. (ref 1.)

Other (plug-in based) technologies are/were

Because of possible security risks, the plug-in technology (based on the Netscape Plugin Application Programming Interface (NPAPI) - will no longer be supported by browsers in the future. Also ActiveX is no longer provided in the Microsoft Edge browser.

Enhancing the dynamic behaviour of your web pages is also possible with the new HTML5, for instance to play interactive content without using plug-ins.

All these solutions are rather page oriented, regarding content, layout and local behaviour.

Responsive web?

But if you need server side information, prepared in a dynamic way, you have to choose a more integrated solution framework. Traditional solutions are based on e.g. Java EE frameworks like JSF (Java Server Faces) or Microsoft .NET ASP (Active Server Pages). Both are based on a "call and response" arrangement, where the client sends a backend request and waits for the result, or synchronous communication.

With the introduction of the XMLHttpRequest, used by AJAX (ref. 2), asynchronous communication became possible. Users do not have to refresh their web page or send themselves a new request to the server side.

Modern frameworks rely on asynchronous communication, but add additional features to offer full-fledged application oriented solutions. Important features include:

Here comes Google's AngularJS, and to be even more actual Angular 2 (ref. 3), into the spotlight. The framework is aimed at developing modern applications:

Angular defines components to display and control data. Each component (a JavaScript class) supports a "view" - part of the screen - and controls the associated data "model" (Do you remember the "good old" MVC paradigm?). Coordinated components make use of services to form an application. Components can be gathered in containers, called "modules".

The client side (browser) JavaScript engine of AngularJS controls/executes these application components, in order to render a nice presentation to the user, and to interact with the backend. To that end, the engine works closely together with the back-end runtime of Node JS which is event-driven server side based. Other elements can also be added to "complete" the application, e.g. Express JS as a backend web application framework, or MongoDB as a NoSQL DB (ever heard of the MEAN stack?).

Together, all these technologies and pieces allow for responsive web-based applications, used by a plethora of different (mobile or desktop) devices.

Conclusion

We tried to introduce the building blocks of (and also the rational behind) a modern web application framework called AngularJS. The mobile world is expanding very fast, and needs new possibilities for developing applications quickly. AngularJS is one of the upcoming environments to support this demand.

 

References

1. List of JavaScript Libraries: https://en.wikipedia.org/wiki/List_of_JavaScript_librarieshttps://en.wikipedia.org/wiki/List_of_JavaScript_libraries

2. Asynchronous JavaScript and XML: https://en.wikipedia.org/wiki/Ajax_(programming)

3. Angular 2: https://angular.io/