jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Müller <thomas.muel...@day.com>
Subject Re: Generics generator class
Date Wed, 06 May 2009 08:21:26 GMT

> i would never write:
> HashMap<String, WorkspaceInfo> wspInfos = Maps.newHashMap();
> but
> Map<String, WorkspaceInfo> wspInfos = Maps.newHashMap();

A agree it's important for use Map/List in interfaces, so the
implementation is flexible.

But for internal usage (fields and local variables), I prefer
declaring the concrete class, because method calls are faster than
interface method calls. That means calling list.size() is a bit faster
when list was declared as an ArrayList.


View raw message