LayoutBuilder
provides a specific {@link Layout} instance. TheBuilder pattern is more suitable for the Layout instantiation to allow simpler reusability of Layout's code. Only the LayoutBuilder of a given layout algorithm is exposed, this way, one can devise different layout algorithms (represented by their respective LayoutBuilder) that uses a same underlying Layout implementation, but that differs only by an aggregation, composition or a property that is set only during instantiation time.
See ClockwiseRotate
and CounterClockwiseRotate
for a simple example of this pattern. Both are LayoutBuilders that instanciate Layouts with a different behaviour (the direction of rotation), but both uses the RotateLayout class. The only difference is the angle provided by the LayoutBuilder on the time of instantiation of the RotateLayout object.
@author Helder Suzuki
|
|
|
|