Home / Design Pattern / Behavioral
Behavioral Design Patterns in Java
Behavioral patterns are about how objects talk to each other and share work. They make communication clear and loosely connected. There are 11 behavioral patterns.
Chain of ResponsibilityA request moves along a chain of handlers.CommandCommand turns a request into an object.InterpreterInterpreter defines a small language (grammar) and a way to read and calculate sentences of that language.IteratorIterator gives a standard way to go through the items of a collection one by one, without showing how the collection is built inside.MediatorMediator is a middle object.MementoMemento saves a snapshot of an object's state so you can go back to it later.ObserverWhen one object changes, all objects that subscribed to it are told automatically.StateState lets an object change its behavior when its internal state changes.StrategyStrategy keeps several ways (algorithms) to do one job in separate classes.Template MethodA parent class fixes the steps of an algorithm.VisitorVisitor lets you add a new operation to many classes without changing those classes.