Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

SCEA Part II - Design Question

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 469
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pramod Patidar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Statefull Session bean. This will provide you a uniform way to maintain session for both web and non-web clients.
 
Pramod Patidar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Khan, I should use SFSB whereever needed.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic