Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes OO, Patterns, UML and Refactoring and the fly likes Question of MVC Design Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Question of MVC Design Pattern" Watch "Question of MVC Design Pattern" New topic
Author

Question of MVC Design Pattern

avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
I have a jsp page.
Is it reasonable that the page have the code "session.setAttribute("abc")" if I use a mvc framework ?

I think the view layer should only the logic for presentation.
I think the "session.setAttribute("abc")" has some smell for bussiness logic.
Can somebody give me other suggestion?

Thanks~


My Way,My Pace
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Maybe that attribute has something to do with Presentation logic. If it does then it complies with MVC object-oriented design pattern.

If that attribute has something to do with Business logic, then it shouldn't be in the JSP page.
 
jQuery in Action, 2nd edition
 
subject: Question of MVC Design Pattern