• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is Marker Or Tagged Interface.Why it need?

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Happy new Year in Advance .I am learning java .Here My doubt is about Marker Interface .Take Example Cloneable Interface it Doesn't Have any Method In it,Clone() method is from Object class,then what is the necessity of implementing the interface .Why it should not be like that.
what is real technolgy behind MarkerInteface and Why we r going to be used in what situations it will needed.And Lastly is there any method related to Serailizable interface if not what it do .
if u could explain with example or real time project it would be better for me
thanks in advaance
bye
yours friend
chinna
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chinna

Did you tried google for searching the purpose of Marker Interface in Java?

Here is one that explain the Marker Interface.

Marker Interface in Java

Naveen
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All marker interfaces exist because the people who wrote them are still learning how to exercise the fundamentals of software development and/or the basic principles of contractual design.

The Cloneable interface may or may not be considered a good example, because it demonstrates how not to write software, in more ways than one. The reason it doesn't have a clone method is not logical and often grinds against the belief system of those who subscribe to, for example, the legitimacy of the Java platform, so it is often difficult to state bluntly why things are the way they are. I suggest you look for some euphemistic expression and attempt to extrapolate truth from that.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you interested in Serialization? Have you read Sun's tutorial?
http://java.sun.com/docs/books/tutorial/essential/io/serialization.html
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
legitimacy of the Java platform

I have no idea what that would mean. Java is a tool that I use to get work done for fun and profit. Seems to do what it was meant to do pretty darned well. Legitimate enough for me.

A marker interface is a simple mechanism to let us ask an object if it would like to be cloned or serialized or participate in some other activity. At some level it is an abuse of interfaces but it works and the Worst Possible Thing That Can Happen as a result is not all that bad.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

There are only two kinds of programming languages: those people always bitch about and those nobody uses. Bjarne Stroustrup



Stan,

Not really a response -- just a comment about your signature.

I remember this quote. Stroustrup said this in response to the complainers of the C++ language. It still amazes me on what could happen in 10 years.

Henry
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tony Morris:
All marker interfaces exist because the people who wrote them are still learning how to exercise the fundamentals of software development and/or the basic principles of contractual design.

The Cloneable interface may or may not be considered a good example, because it demonstrates how not to write software, in more ways than one. The reason it doesn't have a clone method is not logical and often grinds against the belief system of those who subscribe to, for example, the legitimacy of the Java platform, so it is often difficult to state bluntly why things are the way they are. I suggest you look for some euphemistic expression and attempt to extrapolate truth from that.



I'm not so harsh as to impune the responsible parties but I'd have to agree it certainly seems like a great example of what not to do.

Originally posted by Stan James:
I have no idea what that would mean. Java is a tool that I use to get work done for fun and profit. Seems to do what it was meant to do pretty darned well. Legitimate enough for me.



I interpreted it to mean that it goes against the beliefs of what is "good" of the average Java developer. Kind of like saying it's very anti-OO and Java's supporters are all for OO.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"CHINNAAA",

We're a friendly and helpful bunch here at the JavaRanch, but we take our display names very seriously.

We require display names to be two words: Your first name, a space, then your last name. Fictitious names are not allowed.

It appears that you display name was correct and now it is not. Please change it back immediately since accounts with invalid display names get deleted.

thanks,
Dave
reply
    Bookmark Topic Watch Topic
  • New Topic