Java
Families of cross-platform GUI components and their production
buttons: First product hierarchy
package refactoring_guru.abstract_factory.example.buttons;
/**
* Abstract Factory assumes that you have several families of products,
* structured into separate class hierarchies (Button/Checkbox). All products of
* the same family have the common interface.
*
* This is the common interface for buttons family.
*/
public interface Button {
void paint();
}checkboxes: Second product hierarchy
factories
app
Demo.java: App configuration
OutputDemo.txt: Execution result
Last updated