We code and we blog, our experiences!

Tuesday 10 December 2013

Single Page Applications

With web pages becoming more fluid and offering rich interaction with the users, writing codes for such flexible pages presents a complex challenge to developers. That is because the more the elements on a page and more the states of interaction, the complex the code, and laborious its loading on the server side. Loading such huge chunks of code on the server and sending it back and forth according to user action greatly increases the loading time of the page and brings down performance, thus striking a blow to the very intent of creating a fluid experience for the user.
The Single Page Applications approach has emerged as the solution for this challenge. Simply put, SPA is an approach for building web applications that fit on a single page and yet provide a rich experience to the user. While traditional approaches for building web applications entail that a trip needs to be made to the server for every action, i.e. Opening a menu, selecting an item on the menu, etc. The SPA approach allows for an ability to redraw any part of the UI according to the user action, without requiring a round trip to the server. The resultant advantage is easy to discern – simple code, lesser load times, lighters and manageable applications.
While the approach might seem to sophisticated and mind boggling at first glance, a closer scrutiny will reveal that this is nothing but stringing together all the best practices of programming and application development. Writing maintainable code by utilizing standard mechanisms to their maximum potential is the primary USP of an SPA. Single Page Applications score over the traditional approaches on three fronts -
Architecture
While traditional architectures give more emphasis to DOM, in SPA DOM is only restricted to a write only mode, output-ing HTML and operations on elements. No data or states are stored in DOM. Instead a set of in-memory models are used to represent all the intermediate states and can be easily pulled up according to the user action. As a result managing the back and forth loading of states and data becomes much more manageable. Reducing the dependence on DOM also increases cross-browser compatibility.
Asset Packaging
Asset packaging helps in making an application modular, which in turns helps in faster loading and increased performance. Needless to say, assets that are correctly packaged are easily manageable and testable compared to random pieces of codes.
Run Time State
The SPA approach provides greater visibility into the run-time state of an application, since the distance from a HTML event to your event handler is shorter. There is also reduced level of detailing associated with the URL, so that the URL supports one primary activity and the rest of the secondary activities are reset to default on page load. This helps in increased support of bookmarks.
There are quite a number of frameworks prevalent today that support the SPA approach. Prominent among them are -

  • Backbone.js
  • Agility.js
  • Stapes.js
  • Epitome
  • Kendo.UI

Lean Approach
In a nutshell, Single Page Application is a amalgamation of all the good things about coding web applications, and a way to make website more user-friendly and awesome, while still keeping the coder's life easy. This approach is but the outcome of numerous iterations of solving the same problem, and choosing the single golden way from the process. The approach is still in its nascent stages of catching on, but with the number of developers adopting it, SPA is definitely the way to the future.
Resources:

Responsive Web Design – Challenges and Scope for Future

The year 2013 has been dubbed as 'The Year of Responsive Web'. The technology, though still in its nascent form, has taken the world by storm, and is catalyzing a major change change in the way people access information, even as we speak. With the numbers of hand held devices being sold increasing every year (Tablet sales are expected to exceed 100 million this year – Mashable.com), website owners are keener than ever to have websites that will provide a good user experience across all platforms. While the technology might still seem formidable to some due to the fact that it is new and still evolving, it certainly is the way forward for those looking to stay on top.
As the name suggests, Responsive Web Design is the design approach for building websites where-in the code would recognize the device accessing the website and scale the components according to it. For example, the contents and images that are used to load a website on the desktop would get scaled down when the website is viewed from a smart phone. The major advantages of RWD are:



Same code base to load on all platforms.

This makes development simpler and changes easier to incorporate, for otherwise, writing separate codes for each platform would make the code base humongous and difficult to maintain

Better SEO Benefits

When you load the same website with the same URL linking to the same HTML, with only the CSS changing for each device, you derive better SEO results. The same URL will show up on Google searches on all platforms. If there were more than one URLs for different platforms, it might confuse and irk the users since they might end up clicking on the URL meant for a smart phone, on a desktop device. In fact, even Google, the mother of all search engines recommends RWD for websites for a better Google ranking.
However, the one-size-fits-all solution is not always perfect and not without limitations. Some of the major challenges that developers and users alike face with RWD are -
Performance and Speed
Since mobile internet is almost always not as fast as a wired connection, the website loading times on hand held devices might continue to be lower. This is also accentuated by the fact that the a large amount of code still needs to be sent to the device before the application can recognize it and use the code required for that device alone. These factors can greatly bring down the loading speed and thus not give as good a user experience and RWD is supposed to give.
Complexity
Embracing RWD as an approach can be quite a complex process if not handled with diligent planning and some creative designing. Web developers and business owners need to be very clear about what they want the users to see on their websites, when viewed through a desktop or a tablet or a smart phone. Some features that look great on desktop might not work on other devices, and the design should be carried out in such a way that the website looks and feels great on every platform. All this can greatly increase the complexity of creating a responsive website.
The Future
While RWD has entered with a bang and made a comfortable place for itself amongst the most happening technologies of the day, for it to grow further, efforts need to be made to make it more easy and light. One step in that direction is the emergence of RESS, which is defined as a “responsive website with server side detection.” In simple words, with this technique, detection and recognition of the device making a call to the website is transferred to the server side, instead of the client side. The server finds out whether it is a tablet or a PC requesting the website, and send only the code pertaining to that platform to the client. Therefore, the code traveling to the device is largely reduced, and so is the time spent by the device in loading it. And so, better performance and more simplicity!

Resources
http://www.bluetrainmobile.com/blog/the-next-generation-of-responsive-web-design-ress/#.UpQ06NTtmGU
http://inspiredm.com/creating-the-future-of-mobile-responsive-web-design/ http://www.technologybell.com/what-is-role-of-responsive-web-design-in-mobile-seo-strategy/ http://mashable.com/2012/12/11/responsive-web-design/

Cross-platform mobile development tools


Developing applications that are functional across multiple operating systems and devices is perhaps the biggest challenge faced by mobile app developers. The reason being, each of these multiple platforms, like Apple's iOS, Google's Android, Symbian, Windows Mobile, RIM and a number of other players, come with their own set of features and capabilities and behavior. While companies cannot afford to lose the audience across other platforms by choosing to build on just one or two, developing and re-developing of applications for each of these platforms imposes severe strains on the their budget and resources. The ideal solution would be a one-time development process for all platforms, so that the time and cost for creation of an app are reduced and the benefits are results are maximized.
Cross-platform mobile development tools
Tools that enable mobile app development across platforms provide an excellent alternative to separate app development for each OS. These tools are said to realize time and cost savings of up to 30%, according to a report by research2guidance. For the first time in the five years these tools have been in existence, their significance is being acknowledged and more and more companies are shifting towards using these tools in their development processes.
Cross-platform Tools Available Today
Xamarin Studio

Xamarin Studio provides a cross-platform IDE for iOS, Android and Mac. It is modern, sophisticated, with a rich editor and advanced debugging and integration features, that make it a preferred candidate with many mobile app developers. What differentiates it from other players in the CPT space is that Xamarin offers development through a single language, C#, which can work across all the major mobile platforms – iOS, Android and Windows Mobile.
Icenium
Telerik's Icenium is an IDE where you can use your HTML5, CSS and JavaScript skills to develop applications for iOS and Android platforms. An Icenium subscription gives you access to three IDEs – Windows client, web client and Visual Studio Extension, so that you can build and deploy apps from wherever you want, whenever you want. This is possible due to the use of Apache Cordova Network, which gives you the convenience of a local coding environment along with cloud based services.
RhoMobile
With Rhodes, an open source Ruby based framework, RhoMobile enables a single development platform for multiple OSes, like Windows, Android, RIM, iOS and Symbian. And then there is also RhoHub, a hosted development environment and RhoSync, a standalone server that looks after data synchronization with the users' devices.
Titanium
Appcelerator's cross-platform development environment, Titanium is perhaps the most favored cross-platform tool among the developers today. Another open source tool, Titanium allows you to develop applications for mobile, tablet and desktop devices using the traditional web development languages such as JavaScript, Python, PHP, Ruby and HTML. A salient feature of Titanium is that it can provide customizable metrics for actions and events, thus making it ideal for monitoring the usage / popularity of the app, or conducting polls and surveys.
MoSync
This FOSS cross-platform application development SDK incorporates common programming standards by tightly integrating compilers, run time libraries, device profiles and many more. It has an Eclipse based IDE for C/C++ programming, and promises support soon for JavaScript, Python and other languages. The mobile OSes supported are – Android, Symbian, Windows Mobile and Moblin (Linux based). Support for IOS and RIM are coming soon enough, in the upcoming versions.
Resources:
http://www.research2guidance.com/cross-platform-tool-benchmarking-2013/
http://mashable.com/2010/08/11/cross-platform-mobile-development-tools/
http://docs.xamarin.com/guides/cross-platform/getting_started/introducing_xamarin_studio/ http://www.icenium.com/

Twitter Delicious Facebook Digg Stumbleupon