|
Re: What Are Your Java Pain Points, Really?
|
Posted: Feb 12, 2007 10:52 AM
|
|
Reviewing the complaints, there's one language request I agree with. I wish that static methods or constructors could be declared in an interface. For example, I'd like an interface Stringable for objects that can write themselves as a String and read themselves back in. (And, by extension, XMLable, ResultSetable, etc...) A lot already do this, via toString() and valueOf(). But valueOf() is static, so it can't be in an interface. I'd like to be able to declare something like
interface Stringable<T> {
public String toString(); static public T valueOf(String s);
(or, even cooler, declare a constructor) public T(String s); }
One poster wrote:
"The number of Java programs that I have been through wondering - where is the program, seeing instead declarations and design patterns but very little code that *does* something as opposed to telling *me* what I ought or ought not to be doing."
I've seen this too. But is this a Java issue, or a programmer issue? Sometimes I think that all the Pattern Books should be burned, cause too many programmers read a few pattern books and then apply all of those patterns to every problem, whether it makes sense or not. Then thay add an interface for every object. Then they use every 3rd party tool, such as Spring, AOP, JAXB whether it makes sense or not. The result becomes nearly incomprehensible.
|
|