T
Timo Nentwig
Hi!
I like short method names that describe just their purpose in their scope.
So, I prefer moved() to mouseMoved() since I know that it all about mouse
movements.
class Blah implement MouseListener
{
public void moved(int x, int y)
{
}
}
But I ran into problems with such general and simple method names when I
implement an interface with such method names and my class already declares
a method with such a name as well.
class Blah extends Mover implement MouseListener
{
// extends Mover or simple part of Blah
// and does have nothing to do with
// mouse moves at all
public void moved(int x, int y)
{
}
// interface method of MouseListener
public void moved(int x, int y)
{
]
}
So, what I'm going to do is to use an MouseAdapter and an inner class. But I
would like to propose the following:
class Blah extends Mover implement MouseListener
{
// extends Mover or simple part of Blah
public void moved(int x, int y)
{
}
// interface method of MouseListener
public void MouseListener.moved(int x, int y)
{
]
}
What do you think?
I like short method names that describe just their purpose in their scope.
So, I prefer moved() to mouseMoved() since I know that it all about mouse
movements.
class Blah implement MouseListener
{
public void moved(int x, int y)
{
}
}
But I ran into problems with such general and simple method names when I
implement an interface with such method names and my class already declares
a method with such a name as well.
class Blah extends Mover implement MouseListener
{
// extends Mover or simple part of Blah
// and does have nothing to do with
// mouse moves at all
public void moved(int x, int y)
{
}
// interface method of MouseListener
public void moved(int x, int y)
{
]
}
So, what I'm going to do is to use an MouseAdapter and an inner class. But I
would like to propose the following:
class Blah extends Mover implement MouseListener
{
// extends Mover or simple part of Blah
public void moved(int x, int y)
{
}
// interface method of MouseListener
public void MouseListener.moved(int x, int y)
{
]
}
What do you think?