stampit
is a JavaScript module which implements the stamp specification. Stamps are composable factory functions.this.super(data)
.new
keyword: const object = new MyClass()
.GraphPoint
and GraphLine
stamps (aka blueprints, aka factory functions, aka behaviours).Point
stamp.Point
to create a Circle
. We will add radius
property to the mix.Circle
you will actually call TWO different initialisers (aka constructors). Stamps have multiple initialisers. Drawable
behaviour. We have to make sure that developers implement the draw()
method when using this stamp.GraphPoint
stamp.Line
primitive.Point
concern and all related functionality in a separate stamp.Circle
concern and the related functionality separated. Circle
is an extension of the Point
.Tagged
concern in a separate stamp.Colored
concern in a separate stamp.GraphPoint
concern is Circle
, Tagged
and Colored
concerns combined.Line
concern - it has two Points
.GraphLine
- is the Line
but with additional Tagged
and Colored
functionalities.