On 5/31/07, Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:
Hi guys, as a perfect exemple of what I wrote about interceptors, I can use the BindHandler chain to exhibit some of the problems this pattern carries. 1) Debugging nightmare : The BindHandler chain is a composition of 6 handlers. When commuting from one handler to the next one, you have to pass through 4 levels of calls into MINA (which means if you don't have the sources, your are blind). The only way to step through those handlers is to *know* which is next into the chain, and as this chain is supposed to be dynamic (at least theorically), can be more than tricky. And in this case, you will have to set 7 breakpoints...
Yes I don't like this at all. I was not going to allow the merge with this code but I let it pass this time since it can be refactored out later. This pattern is being used far excessively like a sledge hammer on finishing nails and as you state debugging it is a PITA. 2) If you are using Simple authentication, you must go through SASL
configuration and handling. Costly ... 3) the order in which the handler are called will never change : (1) check the parameters, (2) handle the authenticator, (3) get the context (4) process to the bind operation (5) return the result. In this case, we could perectly avoid using a chaining pattern
+1 At some point, I think that we should discuss the chosen
implementation and architecture before going for a complex choice, as soon as it does not freeze the developpement into a net of mails and IRC convo so tight that no code get out of this net.
Alex