• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Business logic

 
Hany Shafik
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question related to MVC. Is the Model in the MVC should contain only Java Beans, I believe that the business logic should be part of the model.
However while reading Sun Certified Enterprise Architect for Java EE Study Guide, in chapter 3, I have found that the business logic is part of the controller.
I think that the flow control and dispatching requests is main task of controller and not business logic
My question is the business logic should be considered as part of the controller or the model.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your business logic should be reusable, and it should go in the business model.

A controller will definitely have logic in it, but 'business logic' typically implies the model.
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One useful perspective is that C-control covers operation of the software engine(s) involved
while the data M-model is designed to support business process. Data integrity goes beyond
the technical problem of protecting the physical data. Most important is to assure that all data
sets make business sense. Hence, lots of business logic right in the data M-model.

Jim ... ...
 
Hany Shafik
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks both Cameron and Jim for clearing that up. it seems the author has his own point of view about this subject.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic