[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    Re: Design question
From:       Stanislav Miklik <stanislav.miklik () gmail ! com>
Date:       2010-02-03 22:01:36
Message-ID: b751edb51002031401x422bdab4hee2cd1de40c5e1f () mail ! gmail ! com
[Download RAW message or body]


Hi,

I am not so familiar with the implementation of web server, but maybe I have
one general hint. You may have consider using singleton pattern, i.e. class
that implements XML-RPC methods will forward requests to the singleton that
can access directly your initialized objects (also non-static).

Regards
Stano

On Wed, Feb 3, 2010 at 19:29, Lars Schnoor <Lars.Schnoor@ifad.dk> wrote:

> Hi
> I am using XML-RPC for a control interface for my application. My
> application starts a web server which loads the class that provides the
> XML-RPC methods.
> I believe that the web server creates a new object of the class that
> implements the XML-RPC methods each time a XML-RPC method is invoked. This
> is not a problem as long as the methods do simple things like the calculator
> example, but if the method should manipulate data that is not passed in by
> the method it becomes a bit more complicated.
>
> When my application starts up I create and initialize some objects, the
> XML-RPC based interface is used to manipulate the objects in my application,
> but since the interface class gets initialized for every method invocation I
> need to make my methods to manipulate the objects static and invoke them
> from the XML-RPC interface. Having to have all methods that should be
> invoked by the XML-RPC interface static is become more and more a problem. I
> was therefore wondering if it is possible to create and initialize the
> XML-RPC interface once and have the web server use this object again and
> again?
> Thanks in advance!
>
> Lars
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic