Hi
I’m currently working for a company that a planning to rewrite an application to J2EE.
Another company is working on a prototype and I’m here to help validate the design and code.
We have to use stored procedures (for security reasons) so CMP’s can not be used. And we didn’t see any reasons then to use BMP given the extra overhead and complexity.
We now have an application with JSP as view, a servlet as controller and a number of action classes (just plain Java klasses that calls the stored procedures).
Whenever a JSP submits to the controller a new action class is instantiated - doing what is needs to do - and is then destroyed.
My fear is that when you have 5.000 concurrent users the number of objects created and destroyed will be massive and leading to severe memory defragmentation and again to a lot of garbage collection which will lower performance.
I thought about implementing the action classes as session beans and that way letting WebSphere take care of the reuse of objects instead of programming this our selves.
I talked to a consultant on another project but he dismissed the idea og using the session beans because it was not ”best practice”.
Does anyone has any comments for or against using the session beans?
Best regards
Thomas
-
J2EE design issue (3 messages)
- Posted by: Thomas Larsen
- Posted on: September 19 2002 05:42 EDT
Threaded Messages (3)
- J2EE design issue by Ravi Shankar on September 19 2002 08:53 EDT
- J2EE design issue by Alex Pisarev on September 19 2002 09:29 EDT
- J2EE design issue by Jim Dempsey on September 19 2002 12:26 EDT
-
J2EE design issue[ Go to top ]
- Posted by: Ravi Shankar
- Posted on: September 19 2002 08:53 EDT
- in response to Thomas Larsen
Why did he think it was not best practice? By action class, I presume it is stateless and performs business logic - exactly what session beans are meant for, seems to me.
Or did he mean using EJB at all is not best practice :-) -
J2EE design issue[ Go to top ]
- Posted by: Alex Pisarev
- Posted on: September 19 2002 09:29 EDT
- in response to Thomas Larsen
Why don't you switch to Struts? Or at least take a look to see how it realized there?
Alex -
J2EE design issue[ Go to top ]
- Posted by: Jim Dempsey
- Posted on: September 19 2002 12:26 EDT
- in response to Alex Pisarev
Why don't you switch to Struts? Or at least take a look
>> to see how it realized there?
Very good suggestion. Struts will maintain instances of your action classes, so you will not have to worry about a large number of object creates/destroys. I would still recommend Session EJBs for your business logic (unless there are no transactional requirements).
Jim