CSC/ECE 517 Fall 2010/ch2 2d aa: Difference between revisions
No edit summary |
No edit summary |
||
Line 32: | Line 32: | ||
=== Scaffolds for Generating Model-View-Controller === | === Scaffolds for Generating Model-View-Controller === | ||
Most of the [http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller MVC] based web application frameworks like Rails, Grails, have this feature.Just as we do for a CRUD generator, we need to provide the minimal information about the Data | Most of the [http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller MVC] based web application frameworks like Rails, Grails, have this feature.Just as we do for a CRUD generator, we need to provide the minimal information about the Data | ||
and generates the Model,Views and controllers for the same, and we have a running piece of code. In this way developer has a | and generates the Model,Views and controllers for the same, and we have a running piece of code. In this way developer has a prototype to work with instead of writing the code from the scratch. This which makes web application development, a breeze. | ||
=== SEO Scaffolds === | === SEO Scaffolds === | ||
Line 42: | Line 42: | ||
=== Simplified web development === | === Simplified web development === | ||
Scaffolding helps the developer to start development with a 'Running' piece of code.The developer can always improvise on the | Scaffolding helps the developer to start development with a 'Running' piece of code.The developer can always improvise on the | ||
prototype to achieve the required functionality.They are well suited for people who are highly result-oriented to respond quickly to the client's demands.Ultimately, they are instrumental in making developer meet even critical deadlines.Using the Rails scaffold generator, it takes only minutes to | prototype to achieve the required functionality.They are well suited for people who are highly result-oriented to respond quickly to the client's demands.Ultimately, they are instrumental in making developer meet even critical deadlines.Using the Rails scaffold generator[http://www.aptana.com/products/radrails 1], it takes only minutes to develop a prototype with basic 'CRUD' functions and a simple user interface. | ||
=== Convention Over Configuration === | === Convention Over Configuration === | ||
For the scaffold generation, user is not expected give plethora of inputs related to the application.Rather, it follows 'Convention over configuration' i.e it adapts naming conventions to map class to database tables. | For the scaffold generation, user is not expected give plethora of inputs related to the application.Rather, it follows [http://en.wikipedia.org/wiki/Convention_over_configuration 'Convention over configuration'] i.e it adapts naming conventions to map class to database tables.This feature makes system development uniform, enabling any new developer to jump in and help more easily.At the same time, it is also very easy to override these conventions. | ||
In CakePHP, a popular web application framework,Model Classnames are singular and camelcased.The table names corresponding to model names are plural and underscored.[http://book.cakephp.org/view/24/Model-and-Database-Conventions 2] | |||
Examples: | |||
Model Names : Employee,GraduateStudent,Person | |||
Corresponding Tables : Employees,Graduate_Students,People | |||
=== Separation of concerns === | === Separation of concerns === |
Revision as of 13:52, 21 September 2010
2d. Scaffolding in Web application frameworks
Rails provides scaffolding for the rapid creation of prototype Web applications. So do many other languages. Write about scaffolds per se, covering the topic in general. For example, what are the main features of scaffolds today? How did scaffolds originate and evolve? Last year we did a very similar topic (you can search our wiki for "scaffold"). But last year's writers just described the various scaffolding frameworks consecutively. They didn't look at all of them and come up with a comprehensive description. You should write about the topic of scaffolding in general, referring to specific scaffolds as examples of certain concepts.
Scaffolding in Web Application frameworks
Introduction
In most of the web applications , irrespective of their complexity, major functionality boils down to accessing the underlying data and presenting them via the User Interface. The four basic functions involved with this data are Create, Read (or Retrieve), Update and Delete(or Destroy), collectively known as the CRUD functionality. Can this 'data', around which the application is centred, be used to build a rapid prototype of our application itself? The answer is 'Yes!' and we can do is through a technique called 'Scaffolding'. Such scaffolded applications can either be used ‘as-is’ or used as prototypes, which are further improvised by the developer. This technique is used by the web developers for rapid development.
‘Scaffolds’ are one of the Wow! factors of the ‘Ruby on rails’ shortened as 'Rails' framework. Ever since, the technique has been absorbed by a multitude of web application frameworks and each of them rendering its own flavor of it. Some of the well known frameworks are Grails,Monorail (.Net),CakePHP, ASP.NET Dynamic Data, Django.
Origin of Scaffolds
Scaffolding was a feature in Rails right from its initial versions. It was either through 'Dynamic scaffolding' in the 1.x versions or through 'Scaffold generation' in the later versions.Though we could not accurately point the 'Origin' of Scaffolds in the web application frameworks, it is worth noting that such a concept of 'rapid development' existed even before Rails and its counterparts existed.Oracle HTML DB renamed as Oracle Application Express is a quintessential example.This helps in reducing the development time of web based applications.However, such applications can be hosted only in an Oracle database as they were created using Oracle's tools.
Types of Scaffolds
Scaffolds could be classified under the following categories based on their functionality.
Scaffolds for generation of Web pages/UI screens
We have scaffolds that are well suited for the presentation logic, requiring only minimal inputs from the users.They also take care of the input validations of elemental components like textboxes, textareas , option buttons and so on.They help in the separation of the presentation logic from the entire application. One such powerful component-based web presentation framework,written in Java is Tapestry.1,2 3
Scaffolds for CRUD functions
'CRUD' functionality is the most elemental part of a scaffold based application. We need to describe the Database (tables and fields) and the pages for the CRUD functions are generated automatically. There are many CRUD scaffolding utilities available. Examples of such CRUD generators are PHP MySQL 1,MVC Scaffold Generator 2
Scaffolds for Generating Model-View-Controller
Most of the MVC based web application frameworks like Rails, Grails, have this feature.Just as we do for a CRUD generator, we need to provide the minimal information about the Data and generates the Model,Views and controllers for the same, and we have a running piece of code. In this way developer has a prototype to work with instead of writing the code from the scratch. This which makes web application development, a breeze.
SEO Scaffolds
We also have scaffolds that can be used for Search Engine optimization. Gaia framework is a pragmatic, agile framework which provides SEO scaffolding facility.Through SEO scaffolding search engines and other non-flash users can access our site easily.
Features of Scaffolds
Simplified web development
Scaffolding helps the developer to start development with a 'Running' piece of code.The developer can always improvise on the prototype to achieve the required functionality.They are well suited for people who are highly result-oriented to respond quickly to the client's demands.Ultimately, they are instrumental in making developer meet even critical deadlines.Using the Rails scaffold generator1, it takes only minutes to develop a prototype with basic 'CRUD' functions and a simple user interface.
Convention Over Configuration
For the scaffold generation, user is not expected give plethora of inputs related to the application.Rather, it follows 'Convention over configuration' i.e it adapts naming conventions to map class to database tables.This feature makes system development uniform, enabling any new developer to jump in and help more easily.At the same time, it is also very easy to override these conventions. In CakePHP, a popular web application framework,Model Classnames are singular and camelcased.The table names corresponding to model names are plural and underscored.2 Examples: Model Names : Employee,GraduateStudent,Person Corresponding Tables : Employees,Graduate_Students,People
Separation of concerns
DRY principle
Design Approach
Ease of re-factoring
Support for testing
Detailed logs of statistics of tests performed
Ease of expansion
Conclusion
External Links [1]