2 More Design Patterns Marker interface Label semantic attributes of a class Observer A way of notifying change to a number of classes State Alter an object's behavior when its state changes Visitor Defines a new operation to a class without changing class
3 Marker Interface Pattern Definition Label semantic attributes of a class Where to use & benefits Need to indicate attribute(s) of a class Allows identification of attributes of objects without assuming they are instances of any particular class
has intentionally blurred sections.
Sign up to view the full version.
4 Marker Interface Pattern Example Classes with desirable property GoodProperty Original Store flag for GoodProperty in each class Using pattern Label class using GoodProperty interface Examples from Java Cloneable Serializable