• Post Reply Bookmark Topic Watch Topic
  • New Topic

SessionFacade design question

 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

What is considered a good design for a SLSB SessionFacade...

- expose only a few methods to the client, but may include many private methods to initiate use case processing (i.e. delegating to ServiceAdapters) and handling some use case processing itself.

- if using BMT, can one transaction be started and ended, followed by another transaction being started and ended? The 2 transactions would be in the same thread, but executed synchronously.

- put all transaction processing in the SessionFacades to centralize the transaction handling.

I want to reduce the number of SLSB in my design by having 3 SessionFacades, and possibly no other SLSB.

Thanks very much in advance.

-Saha
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35744
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saha Kumar:
- expose only a few methods to the client, but may include many private methods to initiate use case processing (i.e. delegating to ServiceAdapters) and handling some use case processing itself.

Yes. In fact, it is better to delegate even earlier and not have the private methods in the session bean. Better to delegate to an other class and have the private methods there. It's easier to maintain/test code that isn't in a session bean.

Originally posted by Saha Kumar:
- if using BMT, can one transaction be started and ended, followed by another transaction being started and ended? The 2 transactions would be in the same thread, but executed synchronously.

I haven't used BMT, but I don't see why not. If you are managing the transaction, you should be able to handle them any way you want.

Originally posted by Saha Kumar:
- put all transaction processing in the SessionFacades to centralize the transaction handling.

This is a common practice.
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeanne,

Thanks for the good information, Jeanne. I want to minimize the number of session beans that I use to increase the response time. I'll try and push some more functionality to the ServiceAdapters or ServiceApps. It may not be appropriate.

I still have 2 questions:

1) If a short response time is required, is the following a problem? is it a good design? :

SLSB (facade) -> SLSB (business) -> <ServiceAdapter, entity bean, pojo>

2) Roughly how many methods are acceptable in a SLSB (facade)? I have read that SLSB can be too large.

Thanks in advance for your valuable advice.

-Saha
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35744
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1 - It depends on how short the response time needs to be. Basically, you need to try it out and see if it meets your requirements. That said, if you are using local interfaces, the additional EJBs are unlikely to be a big performance hit.

#2 - This is actually a design question. There's nothing special about it being a SLSB. How many methods do you find acceptable in an object. 50 is probably too many as it is hard to maintain. A good number is somewhat less, but it depends on personal preference.
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Jeanne your email was helpful. -Saha
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!