Knowledge management : I am collecting here various items about knowledge management
Updated: 2007-02-01; 08:43:20.

 

Subscribe to "Knowledge management" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


Categories: (Check them too. My content isn't all on the main page)

Knowledge Management
Technology
My Hardware
My Software
En français!
Top 20 topics!


Currently reading:

The Second World War, Volume 1: The Gathering Storm by Winston S. Churchill

Beginning Linux Programming (Programmer to Programmer) by Richard Stones and Neil Matthew



www.blogwise.com

Male/31-35. Lives in Canada/Ontario/Ottawa/Manor Park, speaks French and English. Spends 80% of daytime online. Uses a Faster (1M+) connection. And likes Cooking/Reading.
This is my blogchalk:
Canada, Ontario, Ottawa, manor Park, French, English, Male, 31-35, Cooking, Reading.


The Political Compass: Economic Left/Right: -3.50
Authoritarian/ Libertarian:
-2.26


Technorati Profile
Popdex Citations



 
 

26 août 2002

I started coding an NNTP to XML-RPC gateway over the week-end but soon ran into trouble. The documentation to Frontier::Daemon is rather minimal and the book I have dealing with XML-RPC doesn't cover this module as extensively as I wanted to.

I browsed through the xml-rpc group on Yahoo! and found a message from somebody with a problem similar to mine. I noticed that the name of the method exposed to the outside was prefixed with a "virtual" module name. I didn't understand why so I replied to the message and got a enlighten answer explaining that in the case of a module with a lot of exposed method, prefixing the method name helped readability and reduce namespace conflict.

However my problem was still persisting. So I posted back my code and to my surprise, one of the co-author of the book I use as a reference replied with corrections to my code. I'll try to find time to test these today.

When you write an XML-RPC daemon with Frontier::Daemon, you have to list all your methods in the constructor of the daemon:

use Frontier::Daemon;
use News::NNTPClient;

Frontier::Daemon->new(
     methods =>{
          method1 => &method1,
          method2 => &method2,
          method3 => &method3,
     },
     LocalPort => 1234,
) or die "Couldn't start the server";

sub method1 {
}

sub method2 {
}

sub method3 {
}

The problem I see with this is simple: If you change one of the sub name, you have to update the list of methods in the constructor. When you have a lot of subs, you may forget one or have a typo in either the sub name or in the list of method's name. It would be nice to build the list of methods through reflection. When Perl parse the program, it could look into its own internal list of all the sub of the Daemon to generate the list that is used by the constructor. This way, the list of subs in the constructor would always be in sync with the "real" list of subs of the module.

I looked on the web and all I could found rgarding Perl and reflection was a snippet in the section 6.8 of "Advanced Perl programming" and a module on CPAN. I'll take a deeper look at then when I'll have more time...


10:46:26 AM    comment [] 

© Copyright 2007 Charles Nadeau.



Click here to visit the Radio UserLand website.
 



-->
August 2002
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jul   Sep


Google
Search the whole web!
Search Charles radio!


www.flickr.com


Top 5 artists I listen to the most often during the last week:


I subscribe to:

Here's how this works.


Weather in Ottawa:
The WeatherPixie
Weather in Fukuoka:
The WeatherPixie