Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the business requirement for Marker Interface

 
Prasanna Lakshmi Tallapaka
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe Google can help you get started.
 
Prasanna Lakshmi Tallapaka
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20880
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Prasanna Lakshmi Tallapaka
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic