On Nov 10, 2005, at 08:51, Mathieu Longtin wrote:
Speaking of which, I have been wondering why POE is
implemented with a whole bunch of names instead of
references. Any reason for that design decision?
Example:
$kernel->post('resolver', 'resolve',
'response',
$host, 'A', 'IN');
Wouldn't it have been cleaner and less error prone to have
something like this:
$resolver->resolve(&response_callback, $host, 'A', 'IN');
Notice that this way, the compiler can catch most
misspelling.
POE has grown organically, building up from simple ideas with simple
extensions. Not all of its growth is perfect.
There's a new project, POE::Stage on the CPAN. I hope it will
formalize some of the stronger component design patterns that have
arisen over the years. It includes a DNS resolver, but it's not as
featureful as POE::Component::Client::DNS.
By the way, your cleaner example contains an error. :)
--
Rocco Caputo - http://poe.perl.org/