Hi
we want to achieve MVC in java ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek DubeyPosted Apr 3, 2012, 1:47 PM
SenthilkumarPosted Apr 3, 2012, 12:05 AM
There are many example for java MVA pattern.
http://www.austintek.com/mvc/
http://www.roseindia.net/tutorial/java/jdbc/javamvcdesignpattern.html
http://www.leepoint.net/notes-java/GUI/structure/40mvc.html
Sample Applications:
http://www.devdaily.com/ooa-ood/java-model-view-controller-mvc-example-1
Satyapriya NayakPosted Apr 2, 2012, 10:53 PM
Model-1 and Model-2 Architecture.
Model-1 Architecture
In this Architecture all kinds of requirements get fulfilled in one layer. The user provides request to the jsp and the jsp provides response to the user. This Architecture uses a set of jsp to implement presentation logic, business logic, controlling logic. It is suitable for small-scale requirement due to its simplicity. It does not provide reusability.
Model-2 Architecture
This layer is divided into three parts they are as below
1.Model
2.Controller.
3.View.
Model: - This layer implements business logic and contains data. State of users can be stored in this layer. This layer can be created by using a set of java beans.
Controller: - This layer implements controlling logic. It takes decision to make visible appropriate view to the appropriate users. This layer can be created by using a servlet and a set of helper classes. The users gives request to the servlet present in the layer.
View: - This layer implements presentation logic of the application. It provides response to the user. A set of Jsp can be used to create this layer.
MVC Architecture of Java server faces
Model: - Jsp implement business logic with the help of some java beans called as managed bean. The manage bean contains states of the application through the properties and validates users input to create appropriate navigation case for the controlling layer.
Controller: - This layer contains only one servlet to accept request from users provides a predefined servlet known as faces servlet.
View: - This layer can be created in jsf by using a set of jsp or x.html files. Jsf provides a set of tags to support MVC based presentation.
MVC Architecture of struts
Model: - This layer implements business logic and contains data. This can be created by using a set of java beans called as form bean. Struts provide a predefined class as the super class of all form beans.
Controller: - This layer implements controlling logic of the application. It takes decision to make visible appropriate view to appropriate users. This can be created by using a controlling servlet and a set of helper class called as form- action. Struts provide a predefined servlet as the controlling servlet .The controlling servlet receives request from the users. Struts provide a predefined class as the super class of all form action classes.
View: - This layer implements presentation logic. It provides response to the users. This layer can be created by using a set of Jsp.Struts provides tag libraries for this layer.
Thanks