aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes SCEA Part II -  Design Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "SCEA Part II -  Design Question" Watch "SCEA Part II -  Design Question" New topic
Author

SCEA Part II - Design Question

Pramod Patidar
Greenhorn

Joined: Aug 19, 2008
Posts: 8
Gurus,

I am architecting solution for part 2 (old) and have 2 questions
1. Can web client and swing client share same business delegates and service locator?
2. Can I have multiple business delegates and if so does it make sense to introduce a factory of business delegates?

Appreciate your response.

Pramod.
Pedro Erencia
Ranch Hand

Joined: Apr 03, 2008
Posts: 70
Hi,

1. Yes. If the BD is implemented as a Session Bean - and i think you should - it can be accessed either from Swing or Web Client. About Service Locator, it is not intended to be used directly by the clients but by the BD itself, so - indirectly - yes.

2. The number of BD is a personal decission. I'd make a BD for each distinct group of functionalities. Regarding a Factory of BD, if they are Session Beans they are container managed - created, and you must stay away from its creation, so there's no point in a Factory.

Of course, this is just MHO and can be discussed

Originally posted by Pramod Patidar:
Gurus,

I am architecting solution for part 2 (old) and have 2 questions
1. Can web client and swing client share same business delegates and service locator?
2. Can I have multiple business delegates and if so does it make sense to introduce a factory of business delegates?

Appreciate your response.

Pramod.
Pramod Patidar
Greenhorn

Joined: Aug 19, 2008
Posts: 8
Hi Pedro,
Thanks for the reply,
I am also plnning to have BD at web tier and at swing layer. In my point above I was referring BD* below and I would like to have factory for these business delegates.(Please refer following flow)

HTML->CONTROLLER SERVLET->BD*->SERVICE LOCATOR->SESSION BEAN(BD)->...
SWING->CONTROLLER SERVLET->BD*->SERVICE LOCATOR->SESSION BEAN(BD)->...

Do you think any potential issues with that approach?

Also if I follow approach above, I can maintain session on web layer using HTTP session but how should I maintain session on swing layer?

Appreciate your response.

P.S:- I am planning to use stateless session beans as BD on business layer as they defines workflow in the application.

Pramod.
Ashish Sarin
author
Ranch Hand

Joined: Nov 20, 2000
Posts: 432
    
    5
Pramod,

I think you need to ask youself the following questions before making the choice:
1. What value addition you will get by having multiple business delegates ? Can't it be done using a single business delegate for a particular client type ?
2. Is the business delegate for the swing client do something different from the web client business delegate ?

The Business Delegate is always on the client tier ( web or swing ) and not on the business tier. I am not sure but I have never come across any mention of Business Delegate on the business tier. It is part of the Business Tier Patterns but its not deployed on the business tier.

Session management can be done in the swing client cache itself. You can think about using the swing client business delegate to mantain session state.


Author of
Getting started with Spring Framework
Portlets in Action
Spring Roo 1.1 Cookbook
Portlets blogSpring Roo blog
Pramod Patidar
Greenhorn

Joined: Aug 19, 2008
Posts: 8
Hi Ashish,
Thanks for the reply.
1. What value addition you will get by having multiple business delegates ? Can't it be done using a single business delegate for a particular client type ?

PP:-I would like BD to handle only one functional responsibility, This makes me think that I need multiple business delegates. However they'll be shared between 2 clients.

2. Is the business delegate for the swing client do something different from the web client business delegate ?

PP:-No, basically both BD do same job, hence sharing them here.

My session beans are actually session facade not BD(my fault).

Also could you please explain what do you mean by caching on swing client to handle session? My BD interact with session facade(stateless). How do I know if its same client returing here? web container does this for me, but in case of swing I see that I even need have separate logic in my session facade too?

Appreciate your response.

Pramod
mc khan
Greenhorn

Joined: Aug 14, 2008
Posts: 19
Use Statefull Session bean. This will provide you a uniform way to maintain session for both web and non-web clients.
Pramod Patidar
Greenhorn

Joined: Aug 19, 2008
Posts: 8
Thanks Khan, I should use SFSB whereever needed.
 
 
subject: SCEA Part II - Design Question