-
1. Re: Putting Presentation & Business Logic In JSPs
hstech Oct 22, 2001 12:18 AM (in response to 1cuervo)If your question is "will I get away with it?", then the answer really depends on the application. You may get away with it for a very small application that you don't expect to extended over time, but you will likely run into problems with a normal size business application when it comes time to extending or modifying. Either way, it's generally bad to design your application to mix the business and presentation logic.
If you are dedicated to ditching the EJB-tier, make sure you implement your business logic in a dedicated "logical tier" that is not spread through the presentation logic. You should make good use of Facade classes that prohibit the presentation tier knowing too much about the business logic implementation.
Another important point to keep in mind is that business logic is normally much more static than presentation logic (that is, it changes a lot less). Try to keep your static and non-static logic as separate as possible. You will find it easier to extend and modify in the future.
I strongly advise against implementing the above in JSPs (or even in Servlets). Your business logic code should be put into Java classes, and kept very separate to your JSPs and Servlets. This way, if you decide to ever go back to EJBs, then your EJBs simply become wrappers around your business logic classes.
Hope this helps,
Aaron.