chkal / mvc-spec-migration-test

0 stars 0 forks source link

A class named Viewable? #36

Closed chkal closed 8 years ago

chkal commented 9 years ago

Original issue MVC_SPEC-36 created by keilw:

99% or more of all Java elements with a name like "*able" are interfaces. Take Serializable, etc. So Viewable suggests it was an interface, too, but isn't. Since this specification is targeted for Java SE 8 or higher, all relevant features except an explitic new() constructor (something modern APIs more and more tend to avoid anyway ;-) ) can also be used by an interface. So aside from a more than confusing name, it's worth a thought whether or not Viewable may in fact better be an interface not concrete class here?

chkal commented 9 years ago

Comment by Santiago Pericas-Geertsen:

It certainly started as an interface. However, a class is just more convenient in this case. Sometimes a simple class that can be created using new is just fine, no need to make things more complex using factory methods or something similar.

It originates here:

https://jersey.java.net/apidocs/2.8/jersey/org/glassfish/jersey/server/mvc/Viewable.html

Having said that, I'll leave this open to revisit this issue later in the process.

chkal commented 8 years ago

Comment by keilw:

Since it's in the RI, not API it doesn't make it less odd, but tolerable. Other implementations may call it differently ;-)