Meaningless Drivel is fun!
The moose likes Java in General and the fly likes Marker Interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Marker Interfaces" Watch "Marker Interfaces" New topic

Marker Interfaces

Mouli Velu

Joined: Oct 06, 2005
Posts: 12
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.

Regards<br />S.Mouli
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
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.

Tony Morris
Java Q&A (FAQ, Trivia)
I agree. Here's the link:
subject: Marker Interfaces
It's not a secret anymore!