On Thu, May 07, 2015 at 08:53PM, Sergey Evdokimov wrote: > I removed unused methods from GridFunc, size of GridFunc became 4500 line > instead of 8000 line.
Still sounds like an awful lot: perhaps the split refactoring is a good way to deal with it. > > On Thu, May 7, 2015 at 8:13 PM, Alexey Kuznetsov <akuznet...@gridgain.com> > wrote: > > > I like Sergey suggestions. > > > > On Thu, May 7, 2015 at 10:54 PM, Sergey Evdokimov <sevdoki...@gridgain.com > > > > > wrote: > > > > > Hello, > > > > > > I have some suggestions for improvement utility classes. > > > > > > 1.) We have big class org.apache.ignite.internal.util.lang.GridFunc that > > > has a lot of methods in 8000 lines. I propose to split it to several > > > classes where utility methods are group by purpose. For example methods > > to > > > work with IgnitePredicate should be in IgnitePredicates class, methods to > > > work with Iterator should be in IgniteIterators class, etc... Same > > grouping > > > is used in Guava. > > > > > > 2.) Methods like GridFunc.not(IgnitePredicate p) must not return > > anonymous > > > class, it should return class with correct name. When I debug code and > > see > > > to value of variable I cannot understand that is "GridFunc$123", > > something > > > like "GridFunc$PredicateNot" looks much better. > > > > > > 3.) Methods with ugly signature like GridFunc.iterator(Iterable c, > > > IgniteClosure trans, boolean readOnly, @Nullable IgnitePredicate<? super > > > T1>... p) should be split to simple methods like > > > "GridFunc.transform(Iterable itr, IgniteClosure trans)", > > > GridFunc.filter(Iterable itr, IgnitePredicate p), > > > GridFunc.readonly(Iterable c) > > > > > > Thoughts? > > > > > > > > > > > -- > > Alexey Kuznetsov > > GridGain Systems > > www.gridgain.com > >