Dart/Flutter version of Missile Site Demo
Missile Site using Rocket lib which uses SAMCAS library as its engine.
Description
This app implements in Dart using the Flutter platform a demonstration of combining many SAMCAS models into a working app. It demonstrates the SAM pattern proposed by Jean-Jacques Dubray and explained at sam.js.org.
SAM (State-Action-Model) is a software engineering pattern that helps manage the application state and reason about temporal aspects with precision and clarity. In brief, it provides a robust pattern with which to organize complex state mutations found in modern applications.
The Dart version of SAMCAS is a table driven approach to the SAM pattern and extends the SAM pattern by including a simple signal protocol for child models to inform their parents of their state changes.
This app demonstrates:
-
Many
SamModel
s interacting together (parent to child and child to parent). -
More complex widget build structures
-
Use of
Navigator
component to change pages -
State transitions for the
Site
itself as well as the children -
Flutter screen size dependent layout
-
Logging window
The source code available at missile-dart-app along with these documents can be used as a road map to build a SAMCAS application.
The companion Rocket is a simpler application incorporating the SAMCAS facility into a Flutter app.
How to Use
-
You are asked to define the Missile Site. Just pressing the
BUILD
button will build an unnamed default site. Giving the site a name or varying the number of banks will cause the site to be built according to the non-default values. -
You will see one or more Banks. Start the missile in each.
-
Turning on the Auto Mode switch will display the
Incoming
button. Pressing this will launch all available missiless with a delay in between. You will also be asked to choose a delay time (10, 15, 20) seconds. -
When all the missiles are used in a bank it will be marked DEPLETED. Pressing the
Replenish
button will replenish the site. -
When there is only 1 bank left the site will enter a blinking Distressed state.
-
When there are no Banks left the site will enter a Defunct state.
License
Copyright (c) 2020 Steve Pritchard of Rexcel Systems Inc.
Released under the The MIT License
Reference Resources
-
Sam Methodology sam.js.org
-
The SAMCAS library
-
The Rocket lib library
-
The Rocket App a simple SAMCAS example
-
The Missile App a more complex SAMCAS example
Source repository at GitHub
-
samcas-lib-dart SAMCAS library
-
rocket-lib-dart Rocket component
-
rocket-app-dart Rocket app, needs SAMCAS library, Rocket component
-
missile-app-dart Missile App, needs SAMCAS library, Rocket component