> -----Original Message----- > From: Rob Rudin [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 06, 2003 1:23 PM > To: Rickard Öberg > Subject: Re: [OS-webwork] IoC Mini Tutorial [Was: > ParameterAware deprecation] > > > I think one drawback can be that you have to do some extra > null- checking. In the case of a connection, the class probably has a > private instance of Connection, and when it needs to use the > Connection, it might not have a guarantee that the Connection > is not null - i.e. that setConnection has been called. If the > class actively creates its Connection, then it doesn't have to > worry about nulls. Of course, it then has to worry about > database errors that might occur in getting the Connection, > which it doesn't have to worry about in the IoC approach. > > Rob >
Yes and no. You might just choose to let it throw a NullPointerException in that case, since the Connection is supposed to be there, and there's really no recovery case. Jason ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork