• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

implementing project using mvc architecture

 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, ranchers


i am seeking guidance that the current existing project is
in really bad shape, all the pages are in jsp, not architecture was followed.
I have to manage the project and convert the whole project in simple MVC or struts mvc architecture.
please guide me, what would be the sequential steps to implement it.

if any reference book mentioned would be also great help
Thank you in advance.
 
suchit pandya
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you want to know about MVC architecture then you can read head first servlets.
Basically in MVC structure in jsp pages html and any other language such as java script or EL are allowed but i had seen some people use java code in JSP also but its not preferable.

In MVC its model - view and controll. In MVC you need to saperate presentation from business logic. What is wrong currently in your structure?
 
gaurav kant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are looking for MVC then you have many choices, here i am suggesting you two of them
1. Follow MVC in your current running Project.
a) create a controller servlet that will decide the flow
b) For all the business logic create beans and access these beans in your JSPs
c) All the presentation includes in JSPs using EL or JSP tags or scriptlets
i don't think that using scriptlet in JSP is a bad thing. But you must not put your business logic in JSPs or big codes should not be placed on JSPs. If you need some small codes just put in JSP. I agree that scriptlets should not be used in JSPs but it can be used for small codes.

2. Follow Struts:
Its a good practice to follow struts framework. This framework is based on MVC architecture. It make the system robust, powerful and well designed.

Please correct me if i am wrong at any point
 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one more hinderance,
now the manager has asked me not to use struts for implementation of the project,
so not to use struts and have it into MVC based architecture product.

ranchers i do think that

creating controller will give me some extent of MVC,
but i feel it will give me MV+C architecture.

if any guidance please let me know,
and if any book suggestions are there please mention its name.

Thanks in advance
 
gaurav kant
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then why don't you go for 1st option given by me in last reply ....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic