The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
James Clarks wrote:...In the Model-View-Controller design pattern, the Model represents business logic and business data. Data access objects (DAO) objects may be part of a Model, but they are not the only objects that make up a business object Model...
James Clarks wrote:
In the Model-View-Controller design pattern, the Model represents business logic and business data.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Raghavan Muthu wrote:
Overall, having been using the business logic elsewhere. Definitely not much in controllers but in a Utility classes where it is appropriate!
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
James Clarks wrote:
The Model also includes other objects besides data objects. The other Model objects are business objects which contain business logic.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
James Clarks wrote:Actually, the Model-View-Controller object-oriented design pattern does not address software architectures. If you have a very small application that implements the MVC pattern, then it might seem to address the applications "architecture." However, in larger systems, MVC pattern only deals with the application "design", and has nothing to do with the architecture supporting the application.
James Clarks wrote:
Kengkaj, business logic is always part of the Model. It does not matter what implementation technology you choose. And yes, the purpose of the View is to display data extracted from the Model. This is true for any type of implementation. There is much more to the Model than just data however.
James Clarks wrote:
In a Spring implementation, business logic still goes in either POJO or Session EJB, i.e. the implementation of Model.
James Clarks wrote:
If you code business logic anywhere else, such as in Spring classes, then you create a severe artificial dependency on a third-party framework. This should be avoided at all costs.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
13.1.2. Features of Spring Web MVC
Spring's web module provides a wealth of unique web support features, including:
Clear separation of roles - controller, validator, command object, form object, model object,
DispatcherServlet, handler mapping, view resolver, etc. Each role can be fulfilled by a specialized object.
James Clarks wrote:Kengkaj, you seem to be misunderstanding the Spring framework AND the Model-View-Controller design pattern. In the Spring documentation, there is mentiond of a "model object", this is a business object, this contains business logic and this is a part of the Model.
James Clarks wrote:
The Spring mechanisms for connecting to Model and for displaying data from the Model are complex. The framework provides a way to veiw data and to also connect to Model to execute business logic.
James Clarks wrote:
Aside, architectural patterns are design patterns.
Architectural patterns express fundamental structural organization
schemas for software systems. They provide a set of predefined
subsystems. specify thet responsibilities. and include rules and
guidelines for organizing the relationships between them.
A design pattern describes a commonly-recurring structure of
communicating components that solve a general design problem in a
particular context (GHJV95).
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
James Clarks wrote:
13.1.2. Features of Spring Web MVC
Spring's web module provides a wealth of unique web support features, including:
Clear separation of roles - controller, validator, command object, form object, model object,
DispatcherServlet, handler mapping, view resolver, etc. Each role can be fulfilled by a specialized object.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
(Kengkaj) Currently I don't have enough information to discuss about what is "Model" in MVC.
James Clarks wrote:
Kengkaj, what you have failed to mention in your posts about Spring Web MVC is where is the business logic coded? Specify this in terms of Model View Controller. Which area has the business logic?
(Kengkaj) Currently I don't have enough information to discuss about what is "Model" in MVC.
Keep your earlier (above) statement in mind.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
In Spring Web MVC architecture, most of business logic is not part of Model in MVC. To be more specific, most of business logic are "defined" outside MVC, but Controllers call the business logic "inside" their operations. As I explained, most common scenarios of Spring Web MVC implementations inject services (containers of business logic) to Controllers, and in Controllers' methods we call services, build model and return a ModelAndView (container of Model and View) object.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |