GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DesignPattern/Java/marker at master · feixiao/DesignPattern

Expand file tree

/

marker

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

marker

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
etc
etc
 
 
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline
layout pattern
title Marker Interface
folder marker
permalink /patterns/marker/
categories Design
tags
Java
Difficulty-Beginner

Intent

Using empty interfaces as markers to distinguish special treated objects.

alt text

Applicability

Use the Marker Interface pattern when

  • you want to identify the special objects from normal objects (to treat them differently)
  • you want to mark that some object is available for certain sort of operations

Real world examples

  • javase.8.docs.api.java.io.Serializable
  • javase.8.docs.api.java.lang.Cloneable

Credits

  • Effective Java 2nd Edition by Joshua Bloch
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.