That's interesting Peter becuase it would seem to me that passing it to the constructor would be preferrable. Why have a public setter if you don't need it? "Hide by convention, reveal by need" and all that. Further, if the object requires these values to run, my opinion would be these should definitely be passed to the constructor so the object is guaranteed to be properly initialized before anything else can use it. Your thoughts?

On 4/4/06, Peter J. Farrell <[EMAIL PROTECTED]> wrote:

I always try to prefer setter injection versus constructor-arg injection
if at all possible.  I only use constructor-arg inject the object
absolutely requires another object to init and may be consumed  by
another object on its' init. 

Reply via email to