Content deleted Content added
m Updated external links into API docs to use the 1.5 Javadocs |
Changed to use new Template:Javadoc:SE I just created |
||
Line 3:
This pattern allows a class to implement a '''marker interface''', which exposes some underlying semantic property of the class that cannot be determined solely by the class' methods. Whereas a typical interface specifies functionality (in the form of method declarations) that an implementing class must support, a marker interface need not do so. The mere presence of such an interface indicates specific behavior on the part of the implementing class. Hybrid interfaces, which both act as markers and specify required methods, are possible but may prove confusing if improperly used.
One good example of a marker interface comes from the [[Java programming language]]. The
Unfortunately there is a problem with this
Still, this is generally a good idea, as subclasses usually ''do'' inherit behaviors from their parents and should inherit the marker interfaces as well.
Line 11:
==Critique==
This pattern is rather specific to Java. Other object models support richer ways of quickly querying static data. For example, .NET supports attributes that can be used to associate any type of data with a class or with its members.
[[Category:Software design patterns]]
|