Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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 "". 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(" +");

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...


In reply to How to decide which implementation to use? by ruoso

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-08-09 08:19 GMT
Find Nodes?
    Voting Booth?

    No recent polls found