Added README.md
This commit is contained in:
parent
20062faae6
commit
6d87f63ed5
30
marker/README.md
Normal file
30
marker/README.md
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
layout: pattern
|
||||
title: Marker Interface
|
||||
folder: marker
|
||||
permalink: /patterns/marker/
|
||||
categories: Design
|
||||
tags:
|
||||
- Java
|
||||
- Difficulty-Beginner
|
||||
---
|
||||
|
||||
## Intent
|
||||
Using empy interfaces as markers to distinguish special treated objects.
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Marker Interface pattern when
|
||||
|
||||
* you want to identify the special objects from normal objects
|
||||
* define a type that is implemented by instances of the marked class, marker annotations can not do that
|
||||
|
||||
## Real world examples
|
||||
|
||||
* [javase.7.docs.api.java.io.Serializable](https://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html)
|
||||
* [javase.7.docs.api.java.lang.Cloneable](https://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html)
|
||||
|
||||
## Credits
|
||||
|
||||
* [Effective Java 2nd Edition by Joshua Bloch](https://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683)
|
Loading…
x
Reference in New Issue
Block a user