>
> > Hi Jon,
> > thanks for the commit (it is very usefull for people that cannot
actually
> > commit but do use the framework as much as I do!)
> > I don't think it is necessary to check for nulls. The cache reference
> > is itinialized in the init() method of the service.
>
> Right, but there is a case where init() might not be
called...therefore...it
> should be checked.

I am not sure what is that case (maybe when using Turbine outside the
framework?)
How about initializing the cache member in the constructor? Why have some
extra
check each time we want to call a single method from a service whose
primary job is to be fast?

>
> > If we should check for a null in this method, then why we don't check
> > in the getObject method, for example?
>
> Then that is a bug imho.
>
> > The -1 value is also not correct since we are dealing with a
> > service here. The cache Hashtable is just an internal implementation
> > of the service. The user should not care if it is null. So in the case
> > of null, the method should return 0 (a user does not have any
> > idea of the internals of the class). Thus being:
> >       return cache == null ? -0 : cache.size();
>
> No, because null != 0.

Yes, but we are talking about a service here. It should either throw
something like "NotProperlyInitializedException" or return a valid
number (>=0). The -1 denotes an error which should be handled by
an appropriate Exception, if applicable in this case, which is not
imho.

>
> -jon
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to