Strategy Design Pattern Strategy Define a family of algorithms, encapsulate each one, and make them interchangeable.
Strategy lets the algorithm vary independently from clients that use it.
Java AWT Layouts. The AWT Component instances act as strategy contexts allowing you to set the desired strategy implementation via the setLayout method. Classes BorderLayout , FlowLayout , CardLayout , etc., are concrete strategy implementations. Each of them encapsulates their own algorithm of laying out the components on AWT containers.