Infosys delivers concept-to-market software engineering services across the engineering value chain. Our blog will discuss the latest trends in software product engineering, outsourcing, technologies, and address business challenges.

« August 2010 | Main | November 2010 »

September 24, 2010

Embracing the open source world

Eben Moglen, a pioneer of the Free Software Movement, visited the Infosys Bangalore campus on September 16th, 2010. In a rousing talk, he expressed his mind on the need for software to be free to balance power equally in a democratic and free society. Besides, he shared what he felt would be the right recipe that would enable Indian IT companies to break into the global top five list.

Eben's passion for free software reflects in the fact that he is the founder of the Software Freedom Law Center (SFLC), which provides legal support and diplomatic services for free software and counts Richard Stallman's Free Software Foundation - as one of its clients. He has been closely associated with the Free Software Foundation and was involved in the enforcing of the GPL on behalf of the FSF.

A lot of companies in the Indian IT industry exist primarily by servicing 'other people's software'. However, considering that it is primarily product and solution vendors that break into the global top lists, it is important for Indian companies to relate deeply with the free and open source world to be able to innovate independently and produce quality products and solutions. Servicing monopoly software alone and developing vertical software will not be enough for companies to reach the top.

Eben felt that a world with proprietary software was akin to a world with proprietary mathematics or proprietary physics. Imagine how frustrating it would be if you were wanting to find out the square root of a number, and you had to 'buy' from someone to be able to use the square root function. Just as the world of mathematics and physics did not belong to any individual or organization, there was no reason that the same should not be seen in software.

Companies like Microsoft do churn out products and solutions, collaborating with services companies to develop proprietary software. However, such companies have also come to understand that to meet customer demands at the pace necessary, they cannot ignore open source software. Interestingly, Microsoft has been a platinum sponsor of the Apache Software Foundation thus underlining its intentions towards embracing open source software. It wouldn't be surprising if future versions of the Windows OS were built using open source software from FSF for example. Similarly IBM has been open textured for years, Sun Microsystems has embraced open source while Oracle too has realized the need to embrace open source software to stay ahead.

Eben believed that businesses that profit from open source software should contribute to it. SFLC services are used to ensure that licensing conditions of open source software are ethically adhered to - with the main purpose of making sure that people who use them contribute to the movement. He mentioned that Richard Stallman had once told him - Don't ever settle for damages over settlement for compliance - which deeply reflects the ideology of the free software movement (be free to use it but make sure you share). There are tools in the market from Black Duct and Palamida which maintain databases of open source software and help detect presence of undocumented open source software in code base of organizations - and hence it is important that software is used only with the intent of adhering to the conditions of the license. It is important for companies to set up a 'compliance review board' which checks if products using open source software are allowed to use it. Even otherwise, compliance review boards can help determine conditions of any type of software - proprietary software (developed by the company), third party software bought under a commercial license, free open source software under the FOSS license, or a combination of these - to safeguard the interests of the organization from possible litigations.

On the social front, open source software is quite popular in engineering colleges in India because of the difficulties in affording the high costs of proprietary software. There is an incessant demand for open source software to serve as educational tools in such colleges. The education in developing solutions using open source software - should result in a generation of engineers equipped with the knowledge and confidence in engineering industrial/scientific solutions based primarily on open source technologies.

The Free Software Movement seems to aim at a society where knowledge is freely shareable and not within the control of a few. The idea is to promote the idea of developing and using open source software so that the knowledge gained can be shared multiple times to further enhance it. It is common that breakthroughs in medical science are achieved by brainstorming and free sharing of knowledge available - and that will be the case with software too.

 

September 23, 2010

HTML5 - What's new?

T

he wide spread of the Internet has made WebApp (Web Application)  extremely popular and indispensable part of internet usage. As a result, WebApp developers have started seeking "desktop application like" capabilities for their WebApp. Browser vendors have also tried to bridge the gap between the web and desktop platforms by incorporating high performance script-engines and support for (vendor specific) GUI & storage related web APIs in their web-browsers. As a result, the web platform is fast catching up with the capabilities that native desktop applications have enjoyed for decades. Indeed over the last few years, the number of capabilities/features added to the web platform exceeds those added to the desktop platform. The web platform owes its current popularity to scripting engines and a few 3rd party sandbox plug-ins. Script engine optimizations resulted in faster script execution and sandbox plug-ins fulfilled the rich and interactive UE requirement. Today, WebApp developers have exploited Flash, Silverlight technologies to come-up with very innovative online applications like image editing (pixlr, imageeditor), click-less UI concept (dontclick.it) and even video blogging.

If the web platform has attained this maturity with HTML4, what triggered the need for a new HTML5 specification? Let's try answering this question by exploring HTML5.

Specification development in participatory fashion

At the specification level, there is a difference between how HTML4 was developed versus how HTML5 is being developed, as the developers (WHATWG & W3C) claim to have "learnt a lot" from previous experience with HTML4 adoption. Post HTML4 release, it was noticed that apart from supporting the standard HTML4 functionality, web-browser vendors had introduced few features of their own. Examples are marquee (by Microsoft), multicol (by Netscape), sound (by Mosaic), animate (by IBM WebExplorer) and blink (by Netscape). Vendors provided such features on top of the HTML4 specification because they perceived business value in those features, which were of course intentionally not incorporated in the HTML4 specification. So, once non conforming features were made available in a browser, solution developers built their solutions around them. Problems arise when browser vendors decide to stop supporting those features, as these are anyway not part of the HTML4 specifications. Learning from experience, this time apart from coming up with the standard set of specifications, the HTML5 specification developers are also paying keen attention to the web-browser vendor's needs. Vendors are being consulted in the specification creation process at every possible stage. With this kind of collaboration, the expectation is to develop an even more widely acceptable, vendor neutral but still market oriented specification set.

Adding powerful graphic APIs and reducing 3rd party dependency

User interface design is very important as it majorly influences the user's acceptance of a product. Over the years, web-application developers have been writing tricky and complex scripts and using 3rd party controls to develop attractive GUI. Today, rich internet applications are almost always based on Flash, Silverlight or similar technologies. Developers tend to rely on these technologies for rich graphics, media and cross-platform compatibility. The flip side of using such technologies is that WebApp users are expected to install the plug-ins associated with these technologies on their machines. Unfortunately, not all operating systems have these plug-in available for them. That's why W3C probably decided to address this issue in the new specifications. Accordingly HTML5 compatible browsers are expected to inherently support the popularly desired graphic, audio and video capabilities.

To provide desktop-like custom graphics rendering capabilities, HTML5 introduced <SVG>, a persistent state graphic API. The following code snippet demonstrates how simple it is to draw a custom graphic inside an HTML5 browser by embedding a SVG tag in HTML. To render such graphics using HTML4, a web-developer would have typically used images.

SVG_HTML.jpg           .       SVG_Browser.jpg                  

Figure 1  SVG embedded in HTML                                                                   Figure 2  SVG rendered in browser

Similarly, a new <video> tag has also been introduced in HTML5. This tag has the potential to partially replace the object tag but unfortunately, HTML5 does not associate default codec with this tag. The initial recommendation was to have Ogg as the default codec but later, due to possible (and perhaps un-foreseen) patenting issue, this format was dropped. Currently, the open source community is demanding that VP8 be the default format because Google, after acquiring On2 (the original developers of this codec), has announced that this codec will be made available to the open source community.

The idea behind introducing new APIs is to improve the browser capability to inherently support the 3 important interactive capabilities (sound, image and video), so that compatibility of the new generation (i.e. HTML5) WebApp is ensured on all operating systems.

Apart from the graphic APIs, HTML5 has also introduced new controls. The "Date" control is one of them. With Date input-type, every (HTML5) compliant browser would have capability to display the date control. Although, the actual look and feel could differ across vendors, the basic functionality of being able to choose the month, year, date and day would be provided by the browser itself. No 3rd party control would be required for the same.

Similar to Date, Range (i.e. slider) is another newly introduced control. HTML5 captures the functional details of these newly introduced controls in great details, for example, to avoid page layout issues across different browsers HTML5 states even the minutest details like the default size of these controls.

The following code snippet shows how the newly introduced controls look like

Date_Slider_Opera.jpg          .    Date_Slider_Safari.jpg         

Figure 3  Opera - Date and Slide control           Figure 4  Safari - Date (currently not supported) & Slide control


Date_Slider_HTML.jpg

Figure 5  Slider and Calendar HTML5 code

Easy client-side data validation

WebApp developers have been writing rehashed script code for client-side input validation which often involves empty username, address and URL detection. The new specification has simplified this validation task. To perform empty input validation, developers can now associate the "required" attribute so that the web-browser would perform the validation and highlight input field to the user with a visual indication against the empty mandatory field.

One of the very often sought after user input is the e-mail id. HTML5 has proposed an edit control which performs email address validations. This again saves the effort in developing and using commonly written scripts to validate e-mail address

With HTML5, developers can associate the newly introduced "autofocus" attribute with HTML form controls to indicate which form element should have the focus when the page loads.

Required_Opera.jpg

Figure 6  Opera's response to empty date which is marked as a "required" field, Ref: fig 5

A step towards the Semantic Web

Even today experts differ over whether the current state of World Wide Web is 2.0 OR 1.0 but the progression towards the Semantic web is undisputed. By introducing <aside>, <article>, <header> and <footer> tags, HTML5 has enabled semantic web crawlers/agents to decipher information that otherwise would need human intervention.

   HTML4_Page.jpg           HTML5_Page.jpg    

Figure 7  Typical HTML4 page layout                                                    Figure 8  HTML5 page layout

Figures shown above highlight the difference between a typical HTML4 webpage and the HTML5 webpage. A typical HTML4 page heavily uses the div tag to achieve the required page layout. The problem with this approach is that because information (text or image) is always placed inside one or the other div tag, web crawlers/semantic agents fail to differentiate between the main article (that the web-page has to present) and the supplementary details like references, navigation info, header and footer data etc. To fully understand the web-page created using the div tag, the crawler/agent needs human intervention, whereas, a well-formed HTML5 page can be easily and correctly understood on its own.

Unification of DOM structure

The in-memory presentation of the HTML is commonly known as "DOM HTML" OR simply "DOM". Although web-browsers are not obliged to support DOM, since script engines require DOM, browsers are forced to host DOM. One of the short comings of the earlier HTML4 version is that it partly described DOM. Hence, different vendors have (slightly) different DOM tree structures causing script incompatibility issues and increased development/testing effort.  The HTML5 specification decided to fully describe DOM to avoid any vendor specific incompatibility. One can argue that this is too much of detail to be captured at the specification level but it is required to ensure identical DOM structure across all browsers.

 Backward compatibility

After the finalization of the HTML4 specification in 1998 it has hardly been updated. In fact there were attempts to develop XML based alternative for HTML - known as XHTML. The subsequently developed XForms technology was also projected as the next generation 'Form' technology. But gradually it was realized that reach of these XML based web technologies was limited only to RSS and Atom. Hence, browser vendors (Apple, Mozilla and Opera) decided to start developing HTML5 with the intent to be backwardly compatible with HTML4. This was essential as browser vendors had invested considerably in the development and maintenance of browser code targeting HTML4. Based on the past learnings it was also realized that the new specifications should be detailed enough to cover interoperability amongst the various vendors.

Concluding remarks

Above points highlight HTML4 limitations and how HTML5 offers improvised solutions over the same. HTML5 can ease the development effort and help ensuring cross platform compatibility. This is also the reason why web-developers are very excited about it and are eagerly awaiting release of compatible browsers. The browser vendors have already started supporting HTML5 features although the official release of the HTML5 specification is scheduled in next couple of years. The caniuse.com survey states, Firefox 4.0, Safari 5.0 and Chrome 6.0 support 85%+ HTML5 features whereas Opera 10.6 is 75% and IE 8.0 is 26% HTML5 compliant. The new specification is all set to give the required boost to the open standards. Let's hope HTML5 soon becomes the vocabulary for web development.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter