SamModel class

The Model Part of the Complex.

It contains volatile information for the model including the SamHot class where watchable model values are maintained.

The related pattern instances (SamAction, SamState and SamView) of the complex are readonly with a reference pointer from the model to them.

The SamModel is abstract because the implementor extends this class to incorporate customized fields and methods according to the processing requirements. The design should be that even these fields should never be mutated outside of the SamModel.present scope in order to maintain the design principles of SAM.

The SamModel is said to be activated once the SamModel.activate has been called.

Constructors

SamModel()
Singleton constructor used to create pattern instances

Properties

aaaName String
The model name. [...]
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
kids List<SamModel>
get the list of children of this SamModel
read-only
parent SamModel
get the parent SamModel or null
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
samState String
get the present State string. [...]
read-only

Methods

actionCall(Object action, [Map actMap]) → void
Entry point for standard Form Widget actions such as a button press. [...]
activate({bool bLog: false}) SamModel
Activate the SamModel after assert validation. [...]
broken(String err) SamModel
return SamModel after jamming it into SE.ss_broken state with whyBroken set to err.
defReject(SamModel sm, Map req, String msg) → void
A shortcut to jam SamModel into SE.ss_broken state with whyBroken set to msg.
dumpSamHot() String
list all samHot values for debugging
flipState(Object estrState) → void
a shortcut to create a proposal to flip the present SamModel.samState to estrState. [...]
getBuildContext() BuildContext
returns current BuildContext for SamModel [...]
getDefState(String state) DefState
returns the current DefState for this SamModel
getHot(String sym) Object
Return the current sym value and track request for dependency determination.
hasHot(String sym) bool
return true if the sym has a value in the SamHot map.
isState(Object testState) bool
returns true if the current state of this SamModel is testState [...]
makeModel(covariant SamFactory sf, SamAction sa, SamState ss, SamView sv) → void
The abstract method that must be populated that performs customization of the SamModel. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
present(Object expState, Object what, {Map stepParms, Function rejector}) → void
Present a transition proposal to this SamModel model. [...]
presentNow(Object what, {Map stepParms, Function rejector}) → void
A shortcut to call SamModel.present with expState set to this SamModel.samState.
raiseSignal(Object signal, SamReq req) → void
Raise a signal to a parent SamModel. [...]
setHot(String sym, Object value) → void
Set a new value of sym in SamHot and record fact it changed for dependency notification.
toString() String
convenient debug representation of SamModel
override
view() SamView
returns the related SamView for the SamModel
watch(BuildFunc bf) SamWatch
Establish a watch scope and return a SamWatch widget. [...]

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited