MVC design problem

Discussions

Performance and scalability: MVC design problem

  1. MVC design problem (10 messages)

    We are now designing an J2EE implementation and considering how to divide our application to the MVC(Model View Controller)design pattern. Typical model is the ejb, view is the jsp, and controller is the servlet. Do u anyone have any comment if we use a pure Java class/JSP to work as a controller?


    Thanks a lot!
    Paul

    Threaded Messages (10)

  2. MVC design problem[ Go to top ]

    In early development, I'd prefer to use the JSP as your controller too. The servlets require you to shut down your app. server while jsp doesn't...... To provide the 24x7 and to cope with dynamic changes in the business requirements, the controller itself can be built by jsp instead... There are some limitations, but most can be ignored.. However, this is purely depending on your implementation of controller. If your controller does nothing more than forward/include to the right jsp, then the servlet as a controller would be the best solution. However, in the real world, I found out that these controllers also requires lots of changes and enhancements such as the security check, redirection depending on situation and etc.


    Se Hee
  3. MVC design problem[ Go to top ]

    In early development, I'd prefer to use the JSP as your controller too. The servlets require you to shut down your app. server while jsp doesn't...... To provide the 24x7 and to cope with dynamic changes in the business requirements, the controller itself can be built by jsp instead... There are some limitations, but most can be ignored.. However, this is purely depending on your implementation of controller. If your controller does nothing more than forward/include to the right jsp, then the servlet as a controller would be the best solution. However, in the real world, I found out that these controllers also requires lots of changes and enhancements such as the security check, redirection depending on situation and etc.


    Se Hee
  4. MVC design problem[ Go to top ]

    u should stick to using servlet as the controller. After all, JSP is really for the view/display and it should not assume the role of controller.

    Some app server, such as WebLogic allows u to reload the servlet on the fly w/o restarting the server.

    HTH.

    alex
  5. MVC design problem[ Go to top ]

    After a deep rethinking, I have some concerns on both using JSP or Servlet as a controller. If I use either as controller, I will not able to accept multiple type of client. For example, if I build a controller on either JSP or servlet, it works fine for the web client. But, if I want to add one more CORBA client, I may need to rewrite my controller again. So, I think the system should have a controller in the EJB-tier and just use JSP/Servlet as a request forwarder. Pls feel free to comment on my concerns.

    Paul
  6. MVC design problem[ Go to top ]

    essentially i believe u are talking abt having a common interface so that both web-based and non-web-based can use it. The facade pattern should be a good fit here. The facade object will be accessed by both the servlet or any java client.

    alex
  7. MVC design problem[ Go to top ]

    Can you give me a bit explain for the facade object? Is it a EJB or JAVA class?


    Paul
  8. MVC design problem[ Go to top ]

    it's a Java object, which provides a unified interface to both the web-based & non-web-based client.

    alex
  9. MVC design problem[ Go to top ]

    Is there any standard to follow in order to implement a facade object? Can you give me some reference of it?

    Paul
  10. MVC design problem[ Go to top ]

    i would say to stick with the beans for controller implementation...it gives more flexibility..on the other side jsp/servlets are very well suited for view side
  11. MVC design problem[ Go to top ]

    hi Paul,
    Sorry for replying late.

    Do chk out the GOF design pattern book for details.

    HTH.

    alex