Skip to content

Pattern: Factory Method

justinmann edited this page Mar 18, 2017 · 1 revision

The factory method is similar to Abstract Factory, but does not allow multiple versions of the factory class.

It is fairly straightforward to build:

button(
	click() {
		// Handle click
	}
)

buttonFactory(
	create() {
		button()
	}
)		

Clone this wiki locally