MVC x MVC2

Galera sempre que leio alguns artigos ou tutoriais vejo a expressão MVC e/ou MVC-2.
Mas a diferença entre estes padrões exatamente não sei especificar…
Alguém ai sabe quais as principais diferenças entre eles?

Abraços

Me pegou nessa heim Diogo…

hehehhe, pois é…
há diferença nisso, já li, mas sempre acho que é “quase” a mesma coisa…
mas o porque da diferença ainda não sei! Vamos esperar…

eu já li que não existe MVC/MVC2… existe sim model 1 e model 2!

model 1 seria a programação sem separação das camadas, parecido com ASP, PHP…

já o model 2 seria o MVC propriamente dito!

mas ainda estou meio perdido em relação aos MVC(s)…

:wink:

Diogo, tens algum tutorial legal sobre MVC ou MVC2???

estava lendo as blueprints MVC e encontrei o seguinte trecho que esplica muito bem essa diferença:

[quote=“Sun BluePrints”]Structuring the Web Tier
A Model 1 architecture consists of a Web browser directly accessing Web-tier JSP pages. The JSP pages access Web-tier JavaBeans that represent the application model, and the next view to display (JSP page, servlet, HTML page, and so on) is determined either by hyperlinks selected in the source document or by request parameters. A Model 1 application control is decentralized, because the current page being displayed determines the next page to display. In addition, each JSP page or servlet processes its own inputs (parameters from GET or POST). In some Model 1 architectures, choosing the next page to display occurs in scriptlet code, but this usage is considered poor form. (See the design guideline Section 4.2.6.8 on page 89.)

A Model 2 architecture introduces a controller servlet between the browser and the JSP pages or servlet content being delivered. The controller centralizes the logic for dispatching requests to the next view based on the request URL, input parameters, and application state. The controller also handles view selection, which decouples JSP pages and servlets from one another. Model 2 applications are easier to maintain and extend, because views do not refer to each other directly. The Model 2 controller servlet provides a single point of control for security and logging, and often encapsulates incoming data into a form usable by the back-end MVC model. For these reasons, the Model 2 architecture is recommended for most interactive applications.

An MVC application framework can greatly simplify implementing a Model 2 application. Application frameworks such as Apache Struts and JavaServer FacesTM (see Section 4.4.5 on page 114) include a configurable front controller servlet, and provide abstract classes that can be extended to handle request dispatches. Some frameworks include macro languages or other tools that simplify application construction.

The Model 1 architecture can provide a more lightweight design for small, static applications. Model 1 architecture is suitable for applications that have very simple page flow, have little need for centralized security control or logging, and change little over time. Model 1 applications can often be refactored to Model 2 when application requirements change.[/quote]

Rafael, dê uma lida nas blueprints da Sun… são muito legais!

:wink:

Tem em portugol mesmo não?! :yv:

Rafel, aqui no PJ tem um tutorial sobre Design Patterns J2EE que aborda MVC…

:wink: