Where can you place business logic using BaseBeans approach?

Rick Reumann <[email protected]>
Newsgroups gmane.comp.java.mvc.devel
Message-ID <[email protected]>
Imagine an example where you are told that the user
requirement is that the user must be able to enter an annual salary:

Enter your annual salary: ____

So naturally your UserFormBean would have an annualSalary property.

However, you are stuck with an old database that requires the salary for
a person to be entered in as "salary per week" so at some point a
conversion needs to be done (annualSalary/52) and a different field name
of weeklySalary needs to be entered.

Now, the quick and easy way would be to create another field in your
UserFormBean called weeklySalary and when the setMethod for annualSalary
is done it would also do a calculation and set weeklySalary. 

Of course the above is horrible approach. Definitely don't want to be
doing business logic like that in a FormBean. However doing it in the
DAO would be foolish also since the DAO should concern itself only with
the database field "weeklySalary" and shouldn't need to care that it's
getting the data in some obscure way as "annualSalary."

So under this framework where would you handle such a business process?

Thanks,

-- 
Rick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.