On Mar 14, 2007, at 4:17 PM, Emmanuel Lecharny wrote:

Enrique Rodriguez a écrit :

On 3/14/07, Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:

...
I bet that would not be a good idea to remove LdapMessageHandler : it's use to initialize MINA. We iterate through all the declared handler in
LdapProtocolProvider and initialize each handler using reflection...


Actually, it would leave MINA's MessageHandler in the hierarchy, so
the casting just switches to MessageHandler instead of
LdapMessageHandler.  MINA typically uses MessageHandler to do
demuxing, anyway.

LdapMessageHandler extends MessageHandler.

In fact, this refactoring would open up the
possibility of directly using the demux handler in MINA. Furthermore,
it is MessageHandler that provides the method messageReceived that is
used in the current handler demux.  The init() method of
LdapMessageHandler is called with the cfg but it is unnecessary.

It's unnecessary now, but we migth use it later. In my mind, having an intermedirary interface for Ldap message does not harm, and can have some advantages, in the futur. It would be a pity that we have to reintroduce this interface later for some unknown usage...


I haven't looked at this code, but in my experience even when I'm quite sure I know exactly how some currently unused feature that someone else is stubbing their toes on is going to support some great new feature planned for the future, when I'm actually implementing the new feature there's a better way to do it.

popularized as "YAGNI" -- "you ain't gonna need it"

thanks
david jencks



This is really a trivial change.  In fact I did it already locally to
make sure it would work perfectly.

At this point, I guess that Alex may have a better knowledge of this piece of code, and about the reason we have this interface in the first place...

Alex ?


Enrique



Reply via email to