Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Model of MVC

Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to understand the actual meaning of "Model" of MVC.
I know that it encapsulates the Business Logic, but what is exactly "Business Logic"?
- Some authors say that it encapsulates the data...
- Other people say that encapsulate code to interact with a database...
- Others say that encapsulates data and functions...

What is the true?
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on the '-'s
those are right as long as they pertain to the "business" of the client whom you are making a program for.
As for "business logic", this could refer to the way one implements a "business rule" in a program. For example if we have the following business rule:
"A customer order worth more than 5,000 dollars will be applied a discount of 15% on the total price"
And implemented in code in the following sample:

the logic behind the sample code is the "business logic".
As for "model", the sample Order class could represent a data "model". It encapsulates data such as customer, date of purchase, total amount, etc.. It could also interact with the database when saving or extracting these items - with the help of another class or not. It encapsulates business function e.g. getDiscount...
For an MVC framework, business logic e.g. represented by code that computes the discount inside a view component would not be proper as in the following

Instead an OrderBean "loaded" and received from another component via a controller can be used e.g.

Or, for those who find java code inside web pages as evil , they create custom tag to use e.g.

Of course, there are better implementations out there ... and examples...
hope this helps.
[ May 25, 2003: Message edited by: boyet silverio ]
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Velocity and Structs are excellent implemention of MVC for Java servlets.
They are also very popular applications for Servlets development now.
Check them on
Don't touch me. And dont' touch this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic