Marker interface pattern: Difference between revisions

Content deleted Content added
Bluelinking 1 books for verifiability.) #IABot (v2.1alpha3
Bluelinking 1 books for verifiability.) #IABot (v2.1alpha3
Line 7:
| first = Joshua
| title = Effective Java (Second edition)
| page = [https://archive.org/details/effectivejava00bloc_0/page/179 179]
| page = 179
| chapter = Item 37: Use marker interfaces to define types
| year = 2008
Line 13:
| publisher = Addison-Wesley
| url-access = registration
| url = https://archive.org/details/effectivejava00bloc_0/page/179
}}</ref> (also called '''tagging interface'''), and methods that interact with instances of that class test for the existence of the interface. Whereas a typical [[interface (computer science)|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.