What is the use of marker interfaces in Java?
When there is nothing to implement in the marker interfaces like Serializable . . what is the use of implementing it? ...
When there is nothing to implement in the marker interfaces like Serializable . . what is the use of implementing it? ...
It's been discussed before on Stack Overflow that we should prefer attributes to marker interfaces (interfaces without any members). Interface Design article on MSDN asserts this recommendation too: Avoid using marker interfaces (interfaces with no members). Custom attributes provide a way to mark a type. For more information ab...
I see myself regularly confronted with the following problem. I have some kind of Marker Interface (for simplicity let's use java.io.Serializable) and several wrappers (Adapter, Decorator, Proxy, ...). But when you wrap a Serializable instance in another instance (which is not serializable) you loose functionality. The same problem occur...