CSC/ECE 517 Fall 2009/wiki1b 13 a1: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
== Introduction ==
== Introduction ==


The Model View Controller design pattern (MVC) proposes the separation of duties in a software application among three components, each with a distinct and specialized responsibility. The components are a model, a view, and a controller. The model handles the data which is used by the application and the necessary business logic, and is not concerned with the presentation layer or the navigation logic. The view specializes in the presentation of the data or part of it in a way that is accessible to the user, usually a Graphical User Interface (GUI). The controller is in charge of  processing the interaction between the user and the application, usually the navigation logic [10, 15].
The Model View Controller design pattern (MVC) proposes the separation of duties in a software application among three components, each with a distinct and specialized responsibility. The components are a model, a view, and a controller.  
 
* The model handles the data which is used by the application and the necessary business logic, and is not concerned with the presentation layer or the navigation logic.  
 
* The view specializes in the presentation of the data or part of it in a way that is accessible to the user, usually a Graphical User Interface (GUI).  
 
* The controller is in charge of  processing the interaction between the user and the application, usually the navigation logic [10, 15].


'''
'''
Line 12: Line 18:
The MVC pattern was first proposed by "Trygve Reenskaugh in 1979 and implemented by Jim Althoff for Smalltalk-80[8]." The first implementation of MVC took place at the Xerox PARC research lab as part of the Smalltalk-80 user interface [7]. Smalltalk-80 was a highly interactive graphical user interface which became the precursor of the Apple Lisa and later the Macintosh.
The MVC pattern was first proposed by "Trygve Reenskaugh in 1979 and implemented by Jim Althoff for Smalltalk-80[8]." The first implementation of MVC took place at the Xerox PARC research lab as part of the Smalltalk-80 user interface [7]. Smalltalk-80 was a highly interactive graphical user interface which became the precursor of the Apple Lisa and later the Macintosh.


One of the first widely used applications of the MVC pattern on web applications appeared as part of the Java Server Pages (JSP) specification, known as Model 2 [2, 10].  Model 2 implements MVC in Java using Servlets and Java beans to implement web applications. Another very popular Java implementation of the MVC patter is the open source project [http://struts.apache.org/ Apache Struts]. Struts provides the necessary framework to write web applications in Java following the MCV design pattern[1]. The Struts framework has been in wide use since 2001[18].
One of the first widely used applications of the MVC pattern on web applications appeared as part of the Java Server Pages (JSP) specification, known as Model 2 [2, 10].  Model 2 implements MVC in Java using Servlets and Java beans to implement web applications. Model 2 is perhaps the most popular implementation of the MVC pattern currently in use.  


Following the Java implementation came Microsoft's MVC versions for the Active Server Pages platform [16]. Initially MVC was proposed as part of the Microsoft Enterprise Library and recently it has become a full-fledged product, integral part of the latest version of ASP.NET and Visual Studio .NET, http://www.asp.net/mvc/.
Another very popular Java implementation of the MVC pattern is the open source project [http://struts.apache.org/ Apache Struts]. Struts provides the necessary framework to write web applications in Java following the MCV design pattern[1] using Java Server Pages (JSP) and Java Servlets as the main building blocks. The Struts framework has been in wide use since 2001 when the [http://jakarta.apache.org/ Jakarta] project gained popularity [18].


Currently one of the most popular implementations of MVC can be found as part of the Rails framework for web-based development using Ruby. MVC is at the heart of Ruby on Rails and its principles determine how web applications should be structured [14].
Following the Java implementations came Microsoft's MVC versions for the Active Server Pages platform [16]. Initially MVC was proposed as part of the Microsoft Enterprise Library. The enterprise library is basically a set of suggested best practices along with standard code targeted to .NET Framework developers. Recently Microsoft has turned its MVC implementation into a full-fledged product, integral part of the latest version of ASP.NET and Visual Studio .NET, http://www.asp.net/mvc/.
 
Currently one of the most popular implementations of MVC can be found as part of the Rails framework for web-based development using Ruby. MVC is at the heart of [http://rubyonrails.org/ Ruby on Rails] and its principles determine how web applications written in the framework should be structured [14].


== Benefits and Applications ==
== Benefits and Applications ==




The main strength of the MVC pattern is that it separates the data, application, and representation logic form each other. In essence, applications are built using a separation of duties such that elements needed for an application to function are self-contained in distinct components that specializes in one of these core functions. Additional benefits of the MVC pattern include:
The main strength of the MVC pattern is that it separates the data, application, and representation logic from each other. In essence, applications are built using a separation of duties such that elements needed for an application to function are self-contained in distinct components that specialize in one of these core functions.  
 
The MVC pattern is particularly useful in applications where the same data may need to be represented in different ways. An example of this is a web-based catalog that offers a different interface for a desktop web browser and a more streamlined version for a browser used on mobile devices.
 
Additional benefits of the MVC pattern include:


* Increase code reuse
* Increase code reuse
Line 28: Line 40:
* More productive use of programming resources due to specialization. Some members of the team can focus on the data and logic component (model) while others focus on the user interface (view).  
* More productive use of programming resources due to specialization. Some members of the team can focus on the data and logic component (model) while others focus on the user interface (view).  


The MVC pattern is particularly useful in applications where the same data may need to be represented in different ways. An example of this is a web-based catalog that offers a different interface for a desktop web browser and a more streamlined version for a browser on a mobile device.
 


== Different Implementations ==
== Different Implementations ==

Revision as of 02:28, 22 September 2009

History and Applications of the MVC Pattern

Introduction

The Model View Controller design pattern (MVC) proposes the separation of duties in a software application among three components, each with a distinct and specialized responsibility. The components are a model, a view, and a controller.

  • The model handles the data which is used by the application and the necessary business logic, and is not concerned with the presentation layer or the navigation logic.
  • The view specializes in the presentation of the data or part of it in a way that is accessible to the user, usually a Graphical User Interface (GUI).
  • The controller is in charge of processing the interaction between the user and the application, usually the navigation logic [10, 15].

History

The MVC pattern was first proposed by "Trygve Reenskaugh in 1979 and implemented by Jim Althoff for Smalltalk-80[8]." The first implementation of MVC took place at the Xerox PARC research lab as part of the Smalltalk-80 user interface [7]. Smalltalk-80 was a highly interactive graphical user interface which became the precursor of the Apple Lisa and later the Macintosh.

One of the first widely used applications of the MVC pattern on web applications appeared as part of the Java Server Pages (JSP) specification, known as Model 2 [2, 10]. Model 2 implements MVC in Java using Servlets and Java beans to implement web applications. Model 2 is perhaps the most popular implementation of the MVC pattern currently in use.

Another very popular Java implementation of the MVC pattern is the open source project Apache Struts. Struts provides the necessary framework to write web applications in Java following the MCV design pattern[1] using Java Server Pages (JSP) and Java Servlets as the main building blocks. The Struts framework has been in wide use since 2001 when the Jakarta project gained popularity [18].

Following the Java implementations came Microsoft's MVC versions for the Active Server Pages platform [16]. Initially MVC was proposed as part of the Microsoft Enterprise Library. The enterprise library is basically a set of suggested best practices along with standard code targeted to .NET Framework developers. Recently Microsoft has turned its MVC implementation into a full-fledged product, integral part of the latest version of ASP.NET and Visual Studio .NET, http://www.asp.net/mvc/.

Currently one of the most popular implementations of MVC can be found as part of the Rails framework for web-based development using Ruby. MVC is at the heart of Ruby on Rails and its principles determine how web applications written in the framework should be structured [14].

Benefits and Applications

The main strength of the MVC pattern is that it separates the data, application, and representation logic from each other. In essence, applications are built using a separation of duties such that elements needed for an application to function are self-contained in distinct components that specialize in one of these core functions.

The MVC pattern is particularly useful in applications where the same data may need to be represented in different ways. An example of this is a web-based catalog that offers a different interface for a desktop web browser and a more streamlined version for a browser used on mobile devices.

Additional benefits of the MVC pattern include:

  • Increase code reuse
  • Simplifies the process of providing different interfaces to the same functionality
  • Ease of maintenance for web applications
  • More productive use of programming resources due to specialization. Some members of the team can focus on the data and logic component (model) while others focus on the user interface (view).


Different Implementations

In addition to the implementations of MVC already mentioned the following applications implement a version of MVC or a framework that is based on it.

  • Service to Worker Pattern for J2EE applications, intended for Web-based desktop applications, i.e. applications with only one user [18].
  • OpenMVC, open source framework used both in .NET and Java applications.
  • Maverick, is mainly for Java web development but there also are versions for .NET and PHP.
  • Model View Presenter (MVP), not a specific technology but another patter inspired by the MVC. The MVP pattern is widely used on applications written in ASP.NET.

References

[1] Apache Struts Web Application Framework. 2009, http://struts.apache.org/.

[2] Designing Enterprise Applications with the J2EE Platform, Second Edition. 2009, http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html.

[3] ASP.NET MVC : The Official Microsoft ASP.NET Site. 2009, http://www.asp.net/mvc/.

[4] JavaServer Faces Technology. 2009, http://java.sun.com/javaee/javaserverfaces/.

[5] Developer - WebObjects. 2009, http://developer.apple.com/WebObjects/.

[6] BARRETT, R. AND DELANY, S.J. 2004. OpenMVC: a non-proprietry component-based framework for web applications. In WWW Alt. '04: Proceedings of the 13th international World Wide Web conference on Alternate track papers \& posters, New York, NY, USA, ACM, New York, NY, USA, 464-465.

[7] BURBECK, S. 1997. Applications Programming in Smalltalk-80(TM): How to use Model-View-Controller (MVC). 2009, http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html.

[8] CURRY, E. AND GRACE, P. 2008. Flexible Self-Management Using the Model-View-Controller Pattern. IEEE Software 25, 84-90.

[9] FOWLER, M. 2006. GUI Architectures. http://www.martinfowler.com/eaaDev/uiArchs.html.

[10] FREEMAN, E., FREEMAN, E., SIERRA, K. AND BATES, B. 2004. Head First Design Patterns. O'Reilly Media, Inc.

[11] GAMMA, E. 1995. Design patterns: elements of reusable object-oriented software Addison-Wesley, Reading, Mass.

[12] HANSEN, S. AND FOSSUM, T.V. 2005. Refactoring model-view-controller. J.Comput.Small Coll. 21, 120-129.

[13] KRASNER, G.E. AND POPE, S.T. 1998. A Description of the Model-View-Controller User Interface Paradigm in the Small-talk-80 System. 1, 26-49.

[14] SAM RUBY, THOMAS, D. AND DAVID HEINEMEIER HANSSON. Agile Web Development with Rails Pragmatic Bookshelf, .

[15] SKRIEN, D.J. 2009. The Model-View-Controller Architecture. In Object-Oriented Design Using Java, McGraw-Hill Higher Education, , 234.

[16] WALTHER, S. ASP.NET MVC Framework Unleashed. Sams, .

[17] WALTHER, S. 2008. The Evolution of MVC. .

[18] YAN, N., LEIP, D. AND GUPTA, K. 2005. The use of open-source software in the IBM corporate portal. IBM Systems Journal 44, 419-425.


CSC 517 Fall 2009

Wiki 1b Assignment

Author: Newwolf