S
Sideswipe
I have come upon this several times and I am just looking for some
discussion on this:
given:
public class MyClass extends SomeClass<String,Object> {
}
which is better:
MyClass x = new MyClass();
SomeClass<String,Object> x = new SomeClass<String,Object>();
MyClass does nothing at all -- that wasn't a mistake above. It merely
declares generic types.
I like that MyClass reduces overall syntax in the code if I use it
multiple times. It also hides some detailing and allows for extra
functionality moving forward -- all while giving me the same typing
checks. But it seems stupid to me to have a file and class that have
no functional code at all. Potentially not even a constructor.
Thoughts?
discussion on this:
given:
public class MyClass extends SomeClass<String,Object> {
}
which is better:
MyClass x = new MyClass();
SomeClass<String,Object> x = new SomeClass<String,Object>();
MyClass does nothing at all -- that wasn't a mistake above. It merely
declares generic types.
I like that MyClass reduces overall syntax in the code if I use it
multiple times. It also hides some detailing and allows for extra
functionality moving forward -- all while giving me the same typing
checks. But it seems stupid to me to have a file and class that have
no functional code at all. Potentially not even a constructor.
Thoughts?