2005/11/11, Jose Alberto Fernandez <[EMAIL PROTECTED]>: Now I see the main difference between the two approaches. Let's reanalyze the two:
* Jose's approach
The problem here is that IoFilterChain contains some transport-type-specific code so we cannot simply create and construct it. So a new interface 'IoFilterChainBuilder' (I think 'builder' is better than manager here) is introduced.
* Niklas's approach
His approach has advantage over Jose's one because it doesn't introduce any new interface that a user has to learn. But IoFilterChain contains some transport-type-specific code as I mentioned above. We'll have to create an implementation of IoFilterChain which is independent from any transport-type. It should be easy and will be reusable because this chain will be copied into the internal filter chain implementation.
I think Niklas's approach is better because it doesn't introduce a new interface and Jose's approach can be implemented as a simple factory. WDYT?
Niklas provided a preconstructed IoFilterChain, I am passing the code to construct the IoFilterChain. That is the only difference. Should the person doing the binding know which filters are needed for a protocol provided in some other package? Or should that be expressed as part of the code in the package providing the protocol implementation?
* Jose's approach
The problem here is that IoFilterChain contains some transport-type-specific code so we cannot simply create and construct it. So a new interface 'IoFilterChainBuilder' (I think 'builder' is better than manager here) is introduced.
* Niklas's approach
His approach has advantage over Jose's one because it doesn't introduce any new interface that a user has to learn. But IoFilterChain contains some transport-type-specific code as I mentioned above. We'll have to create an implementation of IoFilterChain which is independent from any transport-type. It should be easy and will be reusable because this chain will be copied into the internal filter chain implementation.
I think Niklas's approach is better because it doesn't introduce a new interface and Jose's approach can be implemented as a simple factory. WDYT?
--
what we call human nature is actually human habit
--
http://gleamynode.net/
