ruoso has asked for the wisdom of the Perl Monks concerning the following question:
In the Web Services world, everything is about standards to follow (web services are not just RPC). In practice, some agent (the name given to the code that implements something) implements some Interface (in the OO sense).
While designing an application server... I faced a problem... The application server I'm talking about will be composed by a "Kernel", that will receive the register requests for each "Agent" loaded by the application. Like....
# The Oak2::Kernel namespace will be populated by # some Kernel implementation. The idea is that # Oak2::Kernel is just an API that anyone can # implement. Oak2::Kernel::LocalAgentsOnly->load(); # The following code will load two agents, that will # automatically register itself in the Kernel. Some::Agent->load(); Another::Agent->load();
Now, let's suppose this two different agents provides the same interface... Let's say "http://www.example.com/some/interface". The question completely open is: What would be returned when the user looks up for this interface like...
# This is how it's possible to get any object # anywhere inside the application server... my $impl = Oak2::Kernel->lookup("http://www.example.com/some/interface +");
So, what $impl would be?
- Nothing, Oak2::Kernel would throw an error explaining the user should use a method specifically for multi-implementation interfaces.
- A list or arrayref containing all the implementations for this interface.
- One of the two implementations, randomically selected...
- One of the two implementations, based on some rules (which kind of rules?)
- A proxy object which would propagate all messages to all implementations.
Well, all here is nothing but sketches, so any suggestion is more than wellcome, including its-all-wrong-this-way-would-be-better ones...
Hope you can meditate more than me...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to decide which implementation to use?
by samtregar (Abbot) on Feb 25, 2006 at 00:45 UTC | |
by thor (Priest) on Feb 25, 2006 at 15:29 UTC | |
Re: How to decide which implementation to use?
by kvale (Monsignor) on Feb 25, 2006 at 00:04 UTC | |
Re: How to decide which implementation to use?
by renodino (Curate) on Feb 25, 2006 at 01:27 UTC | |
Re: How to decide which implementation to use?
by rvosa (Curate) on Feb 26, 2006 at 08:54 UTC | |
Re: How to decide which implementation to use?
by valdez (Monsignor) on Mar 02, 2006 at 20:33 UTC |