Marker Interfaces

How does the JVM come to know about the functionality of the Marker Interfaces?
[86 byte] By [Jyothika] at [2007-10-3 6:41:08]
# 1
> How does the JVM come to know about the functionality> of the Marker Interfaces?It doesn't.Kaj
kajbja at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 2
then what is the use of marker interfaces
Jyothika at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 3
> then what is the use of marker interfacesSomeone implements some logic which only works on some certain components.Kaj
kajbja at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 4
> then what is the use of marker interfacesTo be able identify a semantic constraint/feature, and not so much a syntactical one, using instanceof, or to handle only those instances by using the marker-type reference.
CeciNEstPasUnProgrammeura at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 5
Can anyone explain the exact need of marker interface?
Jyothika at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 6

> Can anyone explain the exact need of marker interface?

See reply #4.

..or is there something which you still don't understand? It's very very rare unusual that you create a marker interface so you don't have to think too much about them, and you will probably know when you need one.

Kaj

kajbja at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 7

to serialize, classes have to implement Serializable market interface. only serializable objects can be queued (jms), so in a method that takes an argument to be queued, you can specify the parameter to be of a Serializable object rather than the class name itself. Then this method can be used to enqueue any object thus marked to a jms queue.

mchan0a at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 8

Here's an example I'm using:

I've got a program which displays lots of tables, it doesn't just display them, it prints them and it dumps them to Excell files.

Many of these tables have a total row at the bottom which needs highlighting. I flag the TableModel with a marker interface of my own. Then the various ways that table data is handled, when passed the TableModel, know to use a modifled JTable, or to use special formating flags on the last row.

malcolmmca at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 9
I'd have a factory that create a Renderer given the data provided, or something. Never dealt much with tables, but that's about how I'd do it. Put something in between the model and the component that knows what things are supposed to look like.
CeciNEstPasUnProgrammeura at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 10
Marker Interface article http://anupsabbi.com/index.php?content=articles/java/marker_interfaces.html http://anupsabbi.com
asabbia at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...
# 11
Eight zombie threads revived in as many minutes to post this spam.asabbi, why don't you go somewhere else? I mean how likely is it you'll drum up traffic from here after having demonstrated yourself to be so ignorant and inconsiderate?AR
pbrockway2a at 2007-7-15 1:30:09 > top of Java-index,Java Essentials,Java Programming...