Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Marker Interfaces  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why should we have the marker interfaces?
For example, we have 'Serializable' interface.
The object will be serialized only if the class is implementing serializable.
Why they have implemented in such a way that all the objects are not serializable.
Please give me an answer.
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is a little vague, so I'll make some assumptions.
Why "should" we have them? Quite simply, we shouldn't.
Why "do" we have them? Not all developers are of an expected level of competence, not even at Sun, not even JSR teams.
When will they go away? Sun has implemented annotations in the 1.5 language specification. Although this does not solve them problem of existing APIs that have purported this atrocity, it is at least an acknowledgement (even if inadvertant) of the issue. Prior to 1.5, metadata is best specified using contractual specification in English, or simply, javadoc.
e.g.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!