Added README.md

This commit is contained in:
4lexis 2017-05-03 19:48:29 +02:00 committed by GitHub
parent 20062faae6
commit 6d87f63ed5

30
marker/README.md Normal file
View 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.
![alt text](./marker/etc/MarkerDiagram.png "Marker Interface")
## 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)