wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes What is the business requirement for Marker Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the business requirement for Marker Interface" Watch "What is the business requirement for Marker Interface" New topic
Author

What is the business requirement for Marker Interface

Prasanna Lakshmi Tallapaka
Greenhorn

Joined: May 01, 2010
Posts: 14
Hi,

Could any one please be so kind to help me knowing the business purpose for a Marker Interface. Also, need the list of Marker Interfaces in Java. Many thanks for your help!

Regards.
Jonas Isberg
Ranch Hand

Joined: Mar 18, 2003
Posts: 118
I believe Google can help you get started.
Prasanna Lakshmi Tallapaka
Greenhorn

Joined: May 01, 2010
Posts: 14
Hi Jonas Isberg,

Many thanks for your reply. This was implicit and is going on. But not of much help.

Could any one else help me out.

Many thanks!

Regards.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why do you need a list of marker interfaces in Java? And do you mean a list of the marker interfaces included in the standard JDK?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18509
    
  40

Prasanna Lakshmi Tallapaka wrote:
Many thanks for your reply. This was implicit and is going on. But not of much help.


Can you explain to us why it didn't help? We can't elaborate on your issue if we don't know why.

And explaining what is a marker interface... etc. when the google links does a good job is just a bit silly.



As for the "business requirement" part of your question, that doesn't really make sense. The "marker interface" is a technique (or pattern, for those who like that terminology). It may be used indirectly to solve a "business requirement", but otherwise, is unrelated.

Henry

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Prasanna Lakshmi Tallapaka
Greenhorn

Joined: May 01, 2010
Posts: 14
Hi Henry Wong/David Newton,

Thanks for your responses. I am aware of what a marker interface is. But was not aware as which business requirement would drive a technologist to implement it. Otherwise, even it is fine to think that it is just used for the purpose. Eg : java.io.Serializable is a marker interface implementing which serializes an object. Similarly, java.lang.Cloneable. Thought if I could know some more to store in my KB and share with needy.

I would be glad to know the marker interfaces in standard JDK.

Many thanks to you.

Regards.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

There is an essentially infinite number of ways a marker interface could be used (although these days annotations are probably the preferred choice--marker interfaces were always a bit suspect to me). They're used any time there's a need to indicate or implement capabilities or possibilities outside of a strict class hierarchy.
Kaustubh Sharma
Greenhorn

Joined: Mar 02, 2010
Posts: 28
I think in business it is used because it is easy to understand which class object is going to be serialzed although for that they don't have to implement any method of it, but it is easy understanding for the coder so the mistakes can be avoided.........
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@kaustubh: You're referring to Serializable, I assume. It's not just to "avoid mistakes", it's to tell the JDK that the object may be serialized. And you do need to provide a serialVersionUID even though no methods need to be implemented.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41092
    
  44
But was not aware as which business requirement would drive a technologist to implement it.

It is extremely rare for business requirements to drive technology decisions on such a low level, as Henry pointed out.

You can find a (probably incomplete) list of marker interfaces in the FAQ.


Ping & DNS - my free Android networking tools app
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Ulf Dittmer wrote:It is extremely rare for business requirements to drive technology decisions on such a low level

Unless you have one of those bosses that reads a term somewhere and decides it needs to be used
Prasanna Lakshmi Tallapaka
Greenhorn

Joined: May 01, 2010
Posts: 14
Helo all,

That was fantastic to receive a bunch of responses. Many thanks to all of you. This sufficed my query at last.

Many thanks again.

Regards.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the business requirement for Marker Interface
 
Similar Threads
marker interface
Java
Marker Interface
Marker Interface
Can we create our own Marker Interfaces...?