CSC/ECE 517 Fall 2014/ch1b 34 kr: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 30: Line 30:
==Why AngularJS + Rails?==
==Why AngularJS + Rails?==


One of the key reasons of using AngularJs is Atomicity, i.e. seperation of User Interface from Rails back-end. It provides an opportunity to build a front-end as well as back-end APIs along with your application, it means front-end exposes its methods to the JSON API in the back-end and the front-end API can be clubbed with any back-end and vice-versa without any need for re-configuration.  
One of the key reasons of using AngularJs is Atomicity, i.e. seperation of User Interface from Rails back-end. Increasing number of application these days (Rails Application) are building their own APIs which can they interface with mobile applications (like iOS), or other developer applications can comminicate with their applications, and in our case to communicate with front-end applications.  By following this paradigm, developers gets an opportunity to build a front-end as well as back-end APIs along with your application, it means front-end exposes its methods to the JSON API in the back-end and the front-end API can be clubbed with any back-end and vice-versa without any need for re-configuration.  


So the question is why to club AngularJS with Rails and what are its advantages? AngularJS is a front-end framework, what this means is, it is designed to run on the client side, therefore for any real application requiring CRUD operations a back-end is necessary. This is where Rails comes into picture, it provides a back-end to the AngularJS application so that large amount of data can be stored in database. Another issue with using standalone AngularJS application is that it creates Single-page Applications (SPA), i.e. the same page or components on the page gets refreshed, which makes [http://en.wikipedia.org/wiki/Search_engine_optimization Search Engine Optimization] extremely tricky, as a result the possibility of making the web page searchable reduces drastically. Whereas in case of Rails the web pages are rendered by Rails on the server, which makes them available to Google for SEO based search.
So the question is why to club AngularJS with Rails and what are its advantages? AngularJS is a front-end framework, what this means is, it is designed to run on the client side, therefore for any real application requiring CRUD operations a back-end is necessary. This is where Rails comes into picture, it provides a back-end to the AngularJS application so that large amount of data can be stored in database. Another issue with using standalone AngularJS application is that it creates Single-page Applications (SPA), i.e. the same page or components on the page gets refreshed, which makes [http://en.wikipedia.org/wiki/Search_engine_optimization Search Engine Optimization] extremely tricky, as a result the possibility of making the web page searchable reduces drastically. Whereas in case of Rails the web pages are rendered by Rails on the server, which makes them available to Google for SEO based search.

Revision as of 19:24, 6 October 2014

AngularJS + Rails

Overview

AngularJS is an open source client-side Javascript framework for creating web applications with dynamic web pages and is maintained by Google. AngularJS has extended HTML's syntax and implemented it with Model-View-Controller architecture so that the various components of Javascript can be expressed clearly. It provides functionalities like data binding and dependency injection which helps shorten the crude javascript code. It has a simple object model that supports testability and clean code organization.

Rails is an open source web application framework written in Ruby by David Heinemeier Hansson. It is extremely productive for developing database-backed web applications. It uses Model-View-Controller architecture and requires fewer total lines of code than other frameworks thus making it atleast ten times faster.

Background

AngularJS

AngularJS was developed by Misko Hevery and Adam Abrons at Brat Tech LLC in 2009 as the software behind an oline JSON storage service. Later, it was released as an open source library. The library is being developed and maintained by Hevery with his fellow Google employees.

Rails

Rails was extracted from Basecamp, a project management tool by 37signals but it was released as an open source project in July 2004. It gained fame after Apple decided to ship it with Mac OS X, which was released in October 2007.

Why AngularJS + Rails?

One of the key reasons of using AngularJs is Atomicity, i.e. seperation of User Interface from Rails back-end. Increasing number of application these days (Rails Application) are building their own APIs which can they interface with mobile applications (like iOS), or other developer applications can comminicate with their applications, and in our case to communicate with front-end applications. By following this paradigm, developers gets an opportunity to build a front-end as well as back-end APIs along with your application, it means front-end exposes its methods to the JSON API in the back-end and the front-end API can be clubbed with any back-end and vice-versa without any need for re-configuration.

So the question is why to club AngularJS with Rails and what are its advantages? AngularJS is a front-end framework, what this means is, it is designed to run on the client side, therefore for any real application requiring CRUD operations a back-end is necessary. This is where Rails comes into picture, it provides a back-end to the AngularJS application so that large amount of data can be stored in database. Another issue with using standalone AngularJS application is that it creates Single-page Applications (SPA), i.e. the same page or components on the page gets refreshed, which makes Search Engine Optimization extremely tricky, as a result the possibility of making the web page searchable reduces drastically. Whereas in case of Rails the web pages are rendered by Rails on the server, which makes them available to Google for SEO based search.

Getting Started

Pre-requisite

In order to get started with AngularJS you should must know HTML, CSS & JavaScript. Add-on advantage if you know: Test Driven Development and Behavioral Driven Development. From Rails's point of view you should have working knowledge of Ruby language.

Comparison with other front-end frameworks

Reference Material

References

<references/>

AngularJS + Rails<ref>http://rigor.com/wp-content/uploads/2014/09/angularjs+rails.jpg</ref>
AngularJS + Rails<ref>http://rigor.com/wp-content/uploads/2014/09/angularjs+rails.jpg</ref>
Name AngularJS + Rails
Category Open Source Software
Type Web Application Framework