CSC/ECE 517 Spring 2014/ch1a 1c yj: Difference between revisions
Line 8: | Line 8: | ||
=== Ruby on Rails === | === Ruby on Rails === | ||
[[File:Rails.png]] | |||
* First created: 2003 by David Heinemeier Hansson <ref>http://rubyonrails.org/</ref> | |||
* Current Developer: Rails Core Team | |||
* Current version: 4.0.2 and 3.2.16 | |||
* Licence: Rails under the [http://www.opensource.org/licenses/mit-license.php MIT] license. Ruby under the [http://www.ruby-lang.org/en/LICENSE.txt Ruby License]. | |||
[http://rubyonrails.org/ Ruby on Rails] has been one of the most popular web app frameworks on Ruby <ref>https://www.ruby-toolbox.com/categories/web_app_frameworks</ref>, Some of the famous applications built with Rails can be [http://www.twitter.com/ Twitter] and [http://www.github.com/ Github]. | [http://rubyonrails.org/ Ruby on Rails] has been one of the most popular web app frameworks on Ruby <ref>https://www.ruby-toolbox.com/categories/web_app_frameworks</ref>, Some of the famous applications built with Rails can be [http://www.twitter.com/ Twitter] and [http://www.github.com/ Github]. | ||
==== Strength ==== | ==== Strength ==== | ||
; Faster development | |||
; Less learning curve | |||
; More readable code thanks to Ruby | |||
==== Weakness ==== | ==== Weakness ==== | ||
;Run relatively slow | ; Run relatively slow | ||
: Since Ruby on Rails designed to optimize the development speed and readability, such optimization sacrificed the runtime speed on web applications that was written in rails. In fact, according to performance comparison result published online, the performance of rails on JSON serialization, single query, multiple queries, fortunes, data updates and plain text, are way far from the top tier of all of the frameworks. <ref>http://www.techempower.com/benchmarks/</ref> | : Since Ruby on Rails designed to optimize the development speed and readability, such optimization sacrificed the runtime speed on web applications that was written in rails. In fact, according to performance comparison result published online, the performance of rails on JSON serialization, single query, multiple queries, fortunes, data updates and plain text, are way far from the top tier of all of the frameworks. <ref>http://www.techempower.com/benchmarks/</ref> | ||
;Unique way of thinking | ; Unique way of thinking | ||
: Ruby is a smart language, so as Ruby on Rails. Most of the works on rails seems to be more than straight forward, as well as readable. However, the more people focus on rails, the more they are far from the effort behind. There are more and more frameworks that were inspired by rails, but most of the long-existed large scale works are built based on a traditional way. For most of the times, the way of thinking in Ruby on Rails is not adaptable to other languages. | : Ruby is a smart language, so as Ruby on Rails. Most of the works on rails seems to be more than straight forward, as well as readable. However, the more people focus on rails, the more they are far from the effort behind. There are more and more frameworks that were inspired by rails, but most of the long-existed large scale works are built based on a traditional way. For most of the times, the way of thinking in Ruby on Rails is not adaptable to other languages. | ||
Revision as of 22:11, 10 February 2014
Background
In such internet age, web applications had been highly valued by programmers on the Web. To help those who aimed to utilize the design patterns to produce a maintainable, readable, and high quality code, many object-oriented web frameworks has been released public that allow enthusiastic programmers to take advantage of the well-built developing environment.
You may already see several examples from other chapters(here, here, and here), but today, we are going to deliver several further details on each, based on their strength and weakness, and make a comparision to make the decision on choosing the best object-oriented web frameworks being easier.
Frameworks
As there are tons of object-oriented web frameworks can be found online, we will need to limit only four of the most famous web frameworks we consider will be discussed today.
Ruby on Rails
- First created: 2003 by David Heinemeier Hansson <ref>http://rubyonrails.org/</ref>
- Current Developer: Rails Core Team
- Current version: 4.0.2 and 3.2.16
- Licence: Rails under the MIT license. Ruby under the Ruby License.
Ruby on Rails has been one of the most popular web app frameworks on Ruby <ref>https://www.ruby-toolbox.com/categories/web_app_frameworks</ref>, Some of the famous applications built with Rails can be Twitter and Github.
Strength
- Faster development
- Less learning curve
- More readable code thanks to Ruby
Weakness
- Run relatively slow
- Since Ruby on Rails designed to optimize the development speed and readability, such optimization sacrificed the runtime speed on web applications that was written in rails. In fact, according to performance comparison result published online, the performance of rails on JSON serialization, single query, multiple queries, fortunes, data updates and plain text, are way far from the top tier of all of the frameworks. <ref>http://www.techempower.com/benchmarks/</ref>
- Unique way of thinking
- Ruby is a smart language, so as Ruby on Rails. Most of the works on rails seems to be more than straight forward, as well as readable. However, the more people focus on rails, the more they are far from the effort behind. There are more and more frameworks that were inspired by rails, but most of the long-existed large scale works are built based on a traditional way. For most of the times, the way of thinking in Ruby on Rails is not adaptable to other languages.
CakePHP
Inspired on the Ruby on Rails project and using many of the same concepts, it’s called this way because it was written based on a minimal version of a Rapid Application Framework in PHP. CakePHP is licensed and distributed under the MIT license, and provides an extensible architecture for development of web applications.
The slogan of CakePHP is to “CakePHP makes building web applications simpler, faster and require less code.” [2] Started from 2005, CakePHP has been praised for its security, flexibility, and the support of good MVC convention.
Strengths: Framework is completely open source Speed Scalability Security built-in tools
Weakness: Inability to create tables based on the definition model. No admin interface
Django
This is a high level Python Web framework for rapid development on the Web in an easy way. It mainly focus on the DRY (Don't Repeat Yourself) Principle[7], and it provides several free API’s to handle database-abstraction. According to the documentation, a typical workflow is to get the site as fast as possible, populate the data (as in a content management publishing), to finally develop the data in the same way is presented to the public.
Strength: Easy and fast to learn. Free database access API’s Wide range of reusable apps
Weakness: Terminology. In a MVC framework, the Controller is called “View” and the View is called “template” Some would say that is not big customizable.
Play!
Written in Scala and Java, Play Framework is another choice for Java lovers that was developed based on open source, following the MVC model pattern, and is also inspired on Ruby on Rails and Django. Famous websites built with Play! are LinkedIn, coursera, etc. Play! call itself as “The High Velocity Web Framework For Java and Scala” <ref>http://www.playframework.com/</ref>.
Strength
- Based on a lightweight, stateless, web-friendly architecture
- simplified development cycle
- Provide built-in frameworks for unit testing and functional testing. Allow use to mock a whole application for testing reason
Weakness
- Simple at first, but get complicated when trying to take full advantage <ref name="javacompare">http://zeroturnaround.com/rebellabs/the-2014-decision-makers-guide-to-java-web-frameworks/</ref>
- Significant learning curve when integrating it with any existing build tools and environment. <ref name="javacompare" />
Hyperlinks to important terms
Comparison on Web Frameworks based on feature
Project | Language | Ajax | MVC framework | MVC push-pull | Testing framework(s) | DB migration framework(s) | Security framework(s) | Template framework(s) | Caching framework(s) | Form validation framework(s) | Scaffolding |
Ruby on Rails | Ruby | Prototype, script.aculo.us, jQuery | Yes (ActiveRecord, Action Pack) | Push | Unit Tests, Functional Tests and Integration Tests | Yes | Plug-in | Yes | Yes | Yes | Yes |
CakePHP | PHP >= 5.2 | Prototype, script.aculo.us, jQuery, MooTools | Yes | Push | Unit tests, object mocking, fixtures, code coverage, memory analysis with SimpleTest and XDebug PHPUnit (cakephp 2.0) | Yes, CakePHP Schema Shell by default, and some others | ACL-based | Themes, layouts, views, elements | Memcache, Redis, XCache, APC, File | Validation, security | Yes |
Django | Python | Yes | Yes | Push | unittest, test client, LiveServerTestCase | Provided by South(http://south.aeracode.org/), Django Evolution | ACL-based | Django Template Language | Cache Framework | Django Forms API | No, not by default |
Play | Scala/Java | Yes | Yes | Push-pull | Unit test, Functional test, Selenium | Yes, similar to Ruby on Rails | via Core Security module | Yes | Yes | Server-side validation | Yes |
References
<references/>