Skip to content

Instantly share code, notes, and snippets.

@mrjjwright
Created July 1, 2012 19:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mrjjwright/3029371 to your computer and use it in GitHub Desktop.
AppPlay - an app developer's logic tool
- AppPlay is an interactive logic tool for app developers. Your app
manages lots of related logic:
- States
- Events
- Simple Conditional logic
- Stories
- User Actions
- Screenshots of how things should look.
- This logic is independent of how you technically implement it and
should be maintained outside your code.
- You might already manage your logic in design artifacts,
diagrams, and requirement story tools among other things.
- The cost of maintaining this logic outside your code grows as you go
deeper into development. Your code becomes the single place where
most of the detailed logic is maintained…well besides your brain.
- If your code is really well organized it might represent the
logic well.
- You might use lots of comments in your code.
- Or as we said, you might just keep track of the needed logic in
your head.
- AppPlay is designed to provide a simple fun place to maintain your
logic and have it in sync with your code all the time as you build
and test your app!
- AppPlay lets your build your logic by marrying 2 proven,
straightforward & powerful logic tools into an AppPlay script.
- Finite State Machines - FSM model logic as states that are
transitioned from and to using events. They are a natural and
powerful is a natural way to represent the high level logic of
most of your app and easy to build and maintain visually.
- Stories
- Most developers are doing agile development these days and
know to break the functionality of their app into simple user
stories.
- Stories read in plain language, are understandable by
non-technical folks, and are easy to write and maintain.
- AppPlay brings these 2 together by letting you easily build a set
of finite state machine where each FSM or state is a story.
AppPlay calls this a script.
- Stories can then be "linked" together via events .
- Stories are made of up simple plain language scripts that
tell what the story should do.
- Stories can contain conditional logic and simple sentences
telling what your app will do.
- Here is how this works with your actual app:
- AppPlay has a library for iOS and Mac (more coming soon).
- You can inject your AppPlay script into your app using hotkeys
that format the script output as log statements in the target
language.
- The AppPlay lib will log to a special file as the user interacts
with your app and your app runs.
- The AppPlay tool will listen to that file and show you in real
time visually what states are active!
- You can also also read the script that your app is outputting
(far easier and more useful than reading logs) and AppPlay will
tell you if it differs from what it expects!
- The AppPlay editor lets you toggle between a visual and readable view
of your script.
- The visual view is higher level and highlights the stories as
states that are connected via events.
- In AppPlay's readable mode you write each story line by line
where each line is one of the following:
- Conditionals - any line that begins with if, when, until, or
case. There is no special syntax after that and AppLogic
does not parse the line or put these lines in your code.
- Logs - what you expect your app to output as it runs telling
you what it is doing. AppPlay lets you copy and paste these
lines in many different languages and keep them in sync with
your code. You should be detailed enough to fully convey
what the app is doing but without overly constraining the
technical implementation of the app.
- E.g. "App loads photo from Facebook API"
- You can of course be more detailed than this if you like.
- Objects - AppPlay lets you log any data object at any point
in your app so you can verify that your app's state is what
you expect it to be.
- As your app runs these objects are conveniently visible
right as you read your script so you can don't have to
jump to your IDE.
- Comments - Any line that begins with # or //. Comments are
just for your script and not put in your code
- AppPlay is designed for you to keep a smooth easy flow to the
development of your app.
- AppPlay has a very simple UI with lots of hot key support for
major operations so you can work as quickly as you think.
- You can jump from AppPlay to code and vice-versa easily.
- AppPlay knows every time you launch your app (because it requires
an "App Launched" story) and keeps a history of past app runs.
- AppPlay doesn't use timestamps since they don't tell much anyway.
- Perhaps work on AppPlay profiling so you can tell how long
different parts of your script are taking to execute.
- Perhaps have an easy way to go back to previous runs such as
a series of 10 dots overlaid on a timeline like "1 min 5 min
1hr 1 day" or something like that.
- AppPlay doesn't use log verbosity levels. Instead you can easily
mute and un-mute (using hot-keys) whole stories as you debug
different parts of your app. Stories that are stable and don't
need attention can stay muted. If you change a story, it
automatically becomes un-muted.
- AppPlay collapses your script down to just parts that were active
after the last launch and not muted so you can focus on following
the logic of your app.
- AppPlay also warns you via color coding if your app deviates from
your script so you can find out why.
- You can hover over any logged object to easily read it's
variables and see it's state.
- AppPlay will mark a story as red-hot if it was logged over a
certain number of times (configurable) during a run so you can
see where the functional hot spots of your app are without using
a code profiler.
- AppPlay has built in story and event refactoring so you can
rename them across your script easily.
- You can jump to any story quickly with a Quick Find tool.
- Your AppPlay script can be as well thought out and organized or
thrown together and sloppy as you want it to be..it all depends on
how tightly scripted of an app you need.
- Good scripts tend to make great apps however because it means you
have put more thought into your app.
- AppPlay will help you code in a much more user focused and functional
style than ever before without stopping you from being as detailed as
you want to be!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment