aspose file tools*
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 Spring in Action this week in the Spring 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question of MVC Design Pattern