CSC/ECE 517 Fall 2010/ch3 3a SN: Difference between revisions
No edit summary |
No edit summary |
||
Line 31: | Line 31: | ||
Controller --> Model --> View | Controller --> Model --> View | ||
[5]. Diagram for MVC | [5]. Diagram for MVC | ||
===Push-based vs. Pull-based=== | |||
Frameworks normally follow a “push-based” architecture. They have actions that work on the data and process them and then render or push the data to the views in order for the user to see the result. Examples of web frameworks using this architecture include Rubyon Rails and Spring MVC. The opposite of this is the “pull-based” architecture, sometimes also known as “component-based” architecture. These start from the views which can then pull results from various controllers. Struts2 and others like JBoss use this approach | |||
==A Tool Versus a Language== | |||
As alluded to above, we distinguish between a tool and a language. A hammer is a tool, as is Adobe’s Photoshop. A language is a more general construct generically capable of creating tools, such as Photoshop. Herein the focus is on tools, as most languages of necessity operate at a level of generality not commensurate with the highly repetitive creative and algorithmic underpinnings of Web programs | |||
We now examine some of the available web frameworks in various Object Oriented languages |
Revision as of 01:46, 7 October 2010
Web Frameworks in Object Oriented Languages
An Introduction To Web Frameworks
We, like many others, came to this topic with merely a fuzzy notion of what constitutes a “web framework.” We were not alone. We are confident a framework is not a language with which to write a web site, or a tool to help generate website content. Combing a number of comments from [1], we offer the following:
“A framework is a supplementary, extendable and tested layer built atop a programming language. It implements common design patterns (oft recurring procedures) thereby allowing programmers to focus on higher-level tasks.”
The balance of this page explores some common, and not so common instantiations of this concept.The advantage of web frameworks is that the developer does not have to handle the low level details like protocols, sockets or process and thread management. Frameworks primarily provide libraries for database access, templates for frameworks and also session management. They also focus on code reuse.
Previously, web frameworks were mostly server side technology. But nowadays, with the introduction of interrelated web developement techniques like AJAX, web frameworks have increased their domain to the client side development also. As an example of this new trend, web frameworks can now use the browser at the client side as a full blown execution environment.
Web Framework Architecture:
Before we move on to the web frameworks in different languages, it is imperative for us to understand the basic structure of a web framework.
The Model-View-Controller Architecture
The MVC architecture is a way of demodulizing an application or a part of its interface into three constituent parts
The Model
To manage information and notify the observers when that information changes. As such, a model can contain only data and functionality that are related. So two unrelated groups of data and functionality need two different models
The View
Typically deals with how the user will be able to see the output. A view attaches itself to the model and renders its contents to the display surface. Changes in the model will automatically be incorporated and displayed in the views
The Controller
Mainly responsible for mapping user end action to the application response. It typically accepts input from the user and instructs the model and the views to perform actions based on that action
Input --> Processing --> Output Controller --> Model --> View [5]. Diagram for MVC
Push-based vs. Pull-based
Frameworks normally follow a “push-based” architecture. They have actions that work on the data and process them and then render or push the data to the views in order for the user to see the result. Examples of web frameworks using this architecture include Rubyon Rails and Spring MVC. The opposite of this is the “pull-based” architecture, sometimes also known as “component-based” architecture. These start from the views which can then pull results from various controllers. Struts2 and others like JBoss use this approach
A Tool Versus a Language
As alluded to above, we distinguish between a tool and a language. A hammer is a tool, as is Adobe’s Photoshop. A language is a more general construct generically capable of creating tools, such as Photoshop. Herein the focus is on tools, as most languages of necessity operate at a level of generality not commensurate with the highly repetitive creative and algorithmic underpinnings of Web programs
We now examine some of the available web frameworks in various Object Oriented languages