Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best Approach to Follow

 
Sahil Sharma
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

We have an application, which needs to be restructered to MVC2 architecture.
My problem is that the code of the current application is very messy.

1. JSP contains too much Business Logic.
2. Resultset is being used in JSP.
3. All JSP contains same javascript.
4. Almost all of the classes are interacting with the DB. There is no seperation of DB related logic.
5. Request object is being passed to almost all of the classes.
6. No single point of talk for JSP's, like beans or VO's.

My problem is, which would be an easier approach. Re-structering the current application or creating a new one from the scratch.My personal opinion is that creating a new application from the scratch, especially when all the developers are new, including me . But my manager thinks otherwise. Per him we don't have much time.

Current Architecture is: JSP talking directly to Business classes. No servlet is used. No beans.

-Thanx in advance.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether you rewrite or restructure, you will want to do certain things. You would want the business logic in JavaBeans, you will want a clean separation of your layers. So, get your JSPs to talk to your JavaBeans via a Business Delegate and get your JavaBeans talking to the DB via a DAO. Use Transfer Objects as parameters and return values.

The bare minimum design would be something like this:

JSPs <--> Business Delegate <--> JavaBeans <--> DAO <--> DB

It may be easiest to agree with your manager's view but then effectively rewrite the application .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic