cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Schuller <b.schul...@fz-juelich.de>
Subject Re: Support for stateful services in CXF
Date Fri, 23 Mar 2007 13:31:32 GMT
Hi Sergey,

Sergey Beryozkin wrote:
> Hi Bernd
> 
[....]
> I just feel that with WS-Context (or with approach advocated by that 
> spec) you can preserve the familiar factory-instance relationship, both 
> at the  server and the client
> sides, but the advantages you'd get is :
> * server resource consumption is obviously under more control - just one 
> Account instance, seems pretty important when the large
> number of accounts are there...

Agreed. However you don't have to keep things in memory, the instance could be
created (e.g. retrieved from a database) just for the duration of the request.

> * client-side : what happens when the individual account/server goes 
> down and get restarted from the client perspective holding to a
> reference with uri to the individual account ? If after the restart the 
> individual account gets mapped to the same uri then it's fine

Right, you have to guarantee that individual instances don't change their "identity"
when restarting. You can achieve this by having a persistence layer.

Maybe you are going already one step further and you want to have some sort of
cluster of servers with shared application state? Then WS-Context seems to make
a lot of sense.

> Perhaps, if we look at this slightly differently, using WS-Context would 
> formalize this one possible approach. But from the
> application perspective, noone prevents people from creating one 
> BankService, one AccountService with a stem match (as Gary pointed
> out), have BankService returning multiple EPRs/or just plain URLs all 
> leading to the same Account instance...
> 
> Where I see the advantage of using the context (passing it through the 
> header) is that from the client perspective the Account URI is always 
> the same, and this may pay benefits when restarting, possibly simplify 
> the persistence issues on both sides, etc

Hmmm.... also with plain WS-Addressing the URI would be the same, right?
Maybe I don't get WS-Context correctly, I'll have to do some reading :)


Best regards,
Bernd.

>>
>> thanks for your reply. The way you describe it, WS-Context goes into a 
>> similar direction.
>> IMO it does not matter much if you have a single instance or many 
>> instances of a stateful service,
>> it's just a matter of taste and modelling preference.
>>
>> Sergey Beryozkin wrote:
>>>
>>> What would be your opinion about investing the dev effort into 
>>> WS-Context ? Prehaps the high-level purpose of that spec is not to
>>> deal with bank-account scenarious but the idea would be the same in 
>>> that the account id will be an application-level *context*,
>>> passed as a header, for example.
>>> The advantage is that there will be one Account instance ever which 
>>> will deal with individial accounts by picking up the
>>> application context from the header (account id).
 >>>
>>> Bernd Schuller wrote:
>>>> I was wondering about whether you think it is a good idea to add 
>>>> support for
>>>> stateful services to CXF.
[...]

-- 
Dr. Bernd Schuller

Central Institute for Applied Mathematics
Forschungszentrum Juelich GmbH

mail  b.schuller@fz-juelich.de
phone +49 2461 61 8736
fax   +49 2461 61 6656
blog  http://www.jroller.com/page/gridhaus


Mime
View raw message