Where to put business logic in MVC design?
- by BriskLabs Pakistan
I have created a simple MVC java application that adds records through data forms to a database.
my app collects data, it also validates it and stores it. This is because the data is being sourced online from different users. the data is mostly numeric in nature.
now on the numeric data being stored into database (SQL server) , i wish that my app should be able to perform computations... and display it. the user is not interested in how computations are done so they must be encapsulated. the user must only be able to view the simple computed data which for example A column data - B Column data / C column data etc... and just display it to the user... i know how to write stored procedures for same but i want a 3 tier app
I want the data, that I put into the database as a record, worked upon by performing calculations on it.
However, the original data should remain unaffected, while the new data, post-calculations, must be stored as a new entity record into the database.
Where should I write the code for this background calculation? As it is the rules and business logic... in a new java beans files ?