PROPOSAL: Static Methods in Interfaces (v1.1)
Marek Kozieł
develop4lasu at gmail.com
Wed Mar 18 02:04:19 PDT 2009
W dniu 18 marca 2009 07:14 użytkownik Neal Gafter <neal at gafter.com> napisał:
> On Tue, Mar 17, 2009 at 10:57 PM, Marek Kozieł <develop4lasu at gmail.com>
> wrote:
> > Bad sites:
> > 1. You need know where the methods are and then you can use it.
>
> Yes. That's a good thing, because you don't get what you don't ask
> for or don't want to know about.
>
In my opinion it's bad. Because if u add method that will be visible for all
you concentrate to do it well.
But when you think 'It's only for me, I'll know what is it for.' and then
happen that some one else my find this method or there will be no time to do
it well. Or some one else write it because he didn't know about it.
> > 2. What happen if some one write same method in inherited class and you
> will
> > want use extended one?
>
> Use the old syntax (invoke the method from its static utility class).
>
It's not WYSIWYG.
> > 3. What happen if there will be two extension with same methods:
> > Extension1{
> > void method1(...){...}
> > void method2(...){...}
> > }
> >
> > Extension2{
> > void method1(...){...}
> > void method2(...){...}
> > }
> >
> > ... and u want call Extension1.method1 and Extension2.method2
>
> Then just call them. You aren't required to use extension methods as
> if they are members of the type they extend.
>
> > 3. It's not clear if method is extension or it's in class for the one who
> > read the code.
>
> That's true; you'd have to look at the class documentation AND the
> imports clause.
>
> > I see it MS way solution: good for short projects.
>
> I haven't heard that experience based on the MS solution. On the
> contrary, I've heard that it is very helpful for large scale projects.
> Can you point me to any writeup of this experience?
>
When yuo link few projects and evolve them for few years this little
problems start become annoying.
--
Pozdrowionka. / Regards.
Lasu aka Marek Kozieł
http://lasu2string.blogspot.com/
More information about the coin-dev
mailing list