It's for type-safety. If we were using JDK1.5, we would just have the method return the type specified as the parameter.
-----Original Message----- From: Glen Stampoultzis [mailto:[EMAIL PROTECTED] Sent: Friday, June 17, 2005 3:41 AM To: [email protected]; belaran Subject: Re: Calls to registry.getService() Seems reasonable. I'm wondering why it requires a service name and a interface. I would have thought the service name would be enough to determine what interface applies. -- Glen On 6/16/05, belaran <[EMAIL PROTECTED]> wrote: > Glen, > > IMHO, i agree with Richard, it does seems best practise to "label" the > class you're creating an instance. > Reusabilité of the interface is one, important but you could had that > having a very explicit code is generally good practice... ServiceName allow > you to be be very explicit, as the serviceName will generally be more > clearer than the interface name. > > Belaran > > 2005/6/16, Hensley, Richard <[EMAIL PROTECTED]>: > > > > Glen, > > > > It really depends on whether or not multiple services implementing the > same > > interface will be present in your registry. I personally, always specify a > > service name because it seems like I end up reusing an interface with a > new > > implementation or an implementation with a different configuration, either > > of which has a new name. > > > > Richard > > > > -----Original Message----- > > From: Glen Stampoultzis [mailto: [EMAIL PROTECTED] > > Sent: Wednesday, June 15, 2005 4:55 PM > > To: [email protected] > > Subject: Calls to registry.getService() > > > > I'm wondering which is better practice - calling > > registry.getService(class) or registry.getService(serviceName, class) > > ? > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > -- > Belaran, > "What'do'ya mean ?" > "As a moto, I just avoid meaning anything..." --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
