Closed GoogleCodeExporter closed 8 years ago
We plan to add a create() method to each collection class, but we haven't
gotten to
the multimap classes yet.
Original comment by jared.l....@gmail.com
on 5 Jan 2009 at 12:45
Hello,
In the last release of google-collections (0.9), I've seen some methods such as
Multisets.newLinkHashMultiset() disappear in favor of
LinkHashMultiset.create(). I
would like to know why ? In my opinion the Class.newClass() convention is better
because the method name holds the semantics of what you would like to create,
and
allows you to static import the method.
Is this Class.create() convention something you see propagating throughout the
library, or should this discussion be in an other thread?
Original comment by minouc...@hotmail.com
on 16 Feb 2009 at 1:15
We do plan to switch to methods like LinkedHashMultiset.create() whenever
feasible.
Classes like Multisets will contains methods that support an arbitrary multiset.
Though API design is subjective, that approach seems cleaner and easier to
remember.
To create an instance of class X, you simply call X.create(). We can include a
few
create() versions per class, instead of having a single class with a
proliferation of
factory methods.
Though static imports are no longer feasible, the statement
LinkedHashMultiset.create();
isn't much longer than
newLinkedHashMuliset();
Original comment by jared.l....@gmail.com
on 16 Feb 2009 at 7:02
Closing this bug. Please read
http://code.google.com/p/google-collections/issues/list?updated=25
and have any further discussion there! thanks.
Original comment by kev...@google.com
on 26 Feb 2009 at 5:01
Original issue reported on code.google.com by
tin...@gmail.com
on 5 Jan 2009 at 12:27