Morphtron Components & Containers(MC2) Example - Smalltalk
o_Object new.
o getComponents an OrderedCollection()
o getComponentsNamed: ‘boo’ an OrderedCollection()o componentName ‘an Object’
o componentName: ‘hello’
o componentName ‘hello’oc_Object newNamed: ‘world’.
o addComponent: oc.
o getComponents an OrderedCollection(an Object)
oc container componentName ‘hello’
oc fullName ‘/hello/world’props_Dictionary new.
props at: #mySpecialTrait put: ‘is flexibility - hooray Morphtrons!’
op_Object newNamed: ‘h2′ withProperties: props.
op fetchProperty: #mySpecialTrait ‘is flexibility - hooray Morphtrons!’op_Object newNamed: ‘h2′ withProperties: {#mySpecialTrait. ‘is flexibility - hooray Morphtrons!’}
op fetchProperty: #mySpecialTrait