A Practical Comparison of Agile Web Frameworks
Total Page:16
File Type:pdf, Size:1020Kb
A Practical Comparison of Agile Web Frameworks www.blog.websitesframeworks.com David Díaz Clavijo Tutors: Cayetano Guerra Artal Lydia Esther Bolaños Medina Alexis Quesada Arencibia February 16, 2014 Contents 1 Introduction 1 1.1 Solution approach......................................1 2 Document structure3 3 State of the art 5 3.1 A Comparison Model for Agile Web Frameworks.....................5 3.2 Matt Raible Comparison..................................7 3.3 Wahner web frameworks comparison based on types of websites.............8 3.4 Conclusions......................................... 10 4 Objectives 11 5 Methodology 13 5.1 The comparison of web frameworks............................ 13 5.1.1 Selection of the web frameworks.......................... 13 5.1.2 Test design..................................... 13 5.1.3 Test execution................................... 13 5.1.4 The conclusions.................................. 14 5.2 Project diffusion....................................... 14 6 Resources 15 6.1 Hardware resources..................................... 15 6.2 Software resources..................................... 15 6.3 Service resources...................................... 15 7 Planning 17 8 Project dissemination - the Blog 21 8.1 Setting up the blog..................................... 21 8.2 Logo............................................. 22 8.3 Theme............................................ 22 8.4 Social networks....................................... 23 8.5 WordPress SEO....................................... 23 8.6 Avoiding spamming..................................... 23 8.7 Analyzing incoming traffic................................. 23 i 9 Analysis - Which technologies to choose? 25 9.1 Types of web frameworks.................................. 25 9.2 Statistics usage of server-side programming language................... 26 9.3 Statistics usage of Web frameworks............................ 28 9.3.1 Web frameworks usage growth........................... 29 9.4 Web frameworks benchmarks................................ 30 9.4.1 World Wide Wait.................................. 30 9.4.2 The Great Web Framework Shootout....................... 31 9.4.3 Benchmarking Web Applications and Frameworks................ 33 9.4.4 Rails, Wicket, Grails, Play, Tapestry, Lift, JSP and Context............ 33 9.4.5 Conclusions..................................... 35 9.5 Decided technologies.................................... 35 10 Website and language exercises design 39 10.1 Student background..................................... 39 10.2 Chronological development................................. 39 10.3 Steps............................................. 40 10.4 Timing steps......................................... 40 10.5 Documentation....................................... 41 10.6 Programming exercises................................... 41 10.6.1 The Strings, Files and Regular Expressions exercise............... 41 10.6.2 The Numbers Set exercise............................. 42 10.6.3 The Composite Pattern exercise.......................... 43 10.7 Web Application to develop................................. 44 10.7.1 Requisites...................................... 44 10.7.2 Actors........................................ 44 10.7.3 Use cases...................................... 44 10.7.4 Data Model..................................... 46 10.7.5 Mockup....................................... 47 10.8 The order of development.................................. 58 11 Test execution 61 11.1 Ruby and Ruby on Rails.................................. 61 11.1.1 Ruby........................................ 61 11.1.2 Programming exercises with Ruby......................... 64 11.1.3 Ruby on Rails.................................... 65 11.1.4 Website development with Rails.......................... 66 11.2 Groovy and Grails...................................... 70 11.2.1 Groovy....................................... 70 11.2.2 Programming exercises with Groovy........................ 72 11.2.3 Grails........................................ 72 11.2.4 Website development with Grails......................... 74 11.3 Python and Django..................................... 78 11.3.1 Python....................................... 78 11.3.2 Programming exercises with Python........................ 80 11.3.3 Django....................................... 80 11.3.4 Website development with Django......................... 85 11.4 PHP and CodeIgniter.................................... 89 11.4.1 PHP......................................... 89 11.4.2 Programming exercises with PHP......................... 92 ii 11.4.3 CodeIgniter..................................... 92 11.4.4 Website development with CodeIgniter...................... 97 12 Test results 101 12.1 Programmming languages................................. 101 12.1.1 Comparison of developing time.......................... 101 12.1.2 Readability..................................... 102 12.1.3 Performance.................................... 103 12.1.4 Conclusions..................................... 106 12.2 Web framework comparison................................ 107 12.2.1 Documentation................................... 107 12.2.2 Implementing authentication............................ 108 12.2.3 Implementing Blog, Post and Comment...................... 109 12.2.4 Comparing general features............................ 111 12.2.5 Comparing lines of code.............................. 113 12.3 Conclusions......................................... 114 12.3.1 Concerning the documentation........................... 114 12.3.2 Concerning the authentication system....................... 114 12.3.3 Concerning developing common operations: CRUD............... 114 12.3.4 Concerning the developing times.......................... 115 12.3.5 General conclusions................................ 115 13 Conclusions and future works 117 13.1 Conclusions......................................... 117 13.2 Future works........................................ 118 14 Results of Project Diffusion 119 14.1 Key experts in dissemination................................ 119 14.2 Social networks....................................... 119 14.3 Referrals.......................................... 119 14.4 Visits............................................ 120 14.5 Search Engine Optimization................................ 120 Appendices 121 A Source code of programming exercises 123 A.1 Source code of programming exercises in Ruby...................... 123 A.1.1 Source code of The Strings, Files and Regular Expressions exercise in Ruby... 123 A.1.2 Source code of The Numbers Set exercise in Ruby................ 124 A.1.3 Source code of The Composite Pattern exercise in Ruby............. 126 A.2 Source code of programming exercises in Groovy..................... 128 A.3 Source code of programming exercises in Python..................... 132 A.3.1 Source code of The Strings, Files and Regular Expressions exercise in Python.. 132 A.3.2 Source code of The Numbers Set exercise in Python............... 133 A.3.3 Source code of The Composite Pattern exercise in Python............ 135 A.4 Source code of programming exercises in PHP....................... 136 A.4.1 Source code of The Strings, Files and Regular Expressions exercise in PHP... 136 A.4.2 Source code of The Numbers Set exercise in PHP................. 137 A.4.3 Source code of The Composite Pattern exercise in PHP.............. 140 iii B Examples of implementation source code with different web frameworks 143 B.1 Code Generated vs Modified code in Rails and Grails................... 143 B.1.1 Rails generated code and adaptation........................ 143 B.1.2 Grails generated code and adaptation....................... 147 B.2 Source Code of Post in Django: controllers, views and templates............. 156 B.3 Source code of Post in CodeIgniter: models, controllers and views............ 160 B.4 Search posts implementation in different web frameworks................. 170 Bibliography 173 List of figures 174 List of tables 176 List of lists 177 iv Chapter 1 Introduction Web application frameworks are defined as a set of classes that make up a reusable design for an ap- plication or, more commonly, one tier of one application. This specialization in tiers (persistence, web flow, ...) has led to their classification due to their proliferation. Agile web frameworks are defined as full stack web frameworks for developing an application. In contrast with web application frameworks, they are not specialized in one layer, but offer the full stack. Agile web frameworks started with Ruby on Rails, which defined a new approach to web development, based on a single web framework. Ruby on Rails follows the principles of convention over configuration and don’t repeat yourself, providing an agile web development framework that simplifies the develop- ment process and increases productivity for prototyping web applications. When a subject, a programmer or a business, is beginning to develop a web project, it is a hard decision which agile web framework to choose. Learning how to use a full stack web framework is a high time consuming task, it can take two months to get started and one year to have some level of expertise. Therefore, experienced programmers can wonder if it is worthy to migrate from a known framework to a new one and inexperienced programmers or startups do not know which one to choose, neither they have tools to choose the right one. This project tries to analyze the existing