Skip to content

Pattern: Composite

justinmann edited this page Nov 12, 2017 · 3 revisions

The composite pattern is used to divide the task into many smaller classes, usually where each of those classes are derived from a common base class. In SJ, there is no support for derived classes so we accomplish the same behavior using a base interface:

#node(
	click()
	getChildren()'list!#node
)

button #node (
	click()
	getChildren()'list!#node
) { this }

table #node (
	click()
	getChildren()'list!#node
) { this }

Clone this wiki locally