Orangevolt Ampere

Scalable single web page applications made easy.

Created by Lars Gersmann / orangevolt.com

About

Orangevolt Ampere is a technology do define programs by modeling your application as a state machine.

Why Ampere

Whats missing in existing SPA frameworks ?

  • Routes are stateless
  • Routes have no dependencies.
  • Data is passed by route parameters
  • Reusability is problematic

Why Ampere

Ampere applications are modeled as states and transitions instead of routes.

  • States encapsulate logic
  • Transitions are directed routes between states
  • Transitions manage data between states
  • Ampere modules provide reusability

What else ?

  • Infinite Undo/Redo support
  • Transitions are transactional
  • Everything is a Deferred/Promise
  • Reusable as Ampere modules
  • Simplification

And now the burner ...

You can explain your application with non programmers !

Ampere Essentials

Ampere consists of

Ampere Essentials

Ampere

  • named singleton / domain object
  • encapsulates modules.
  • can separate the same module differently configured

* In most cases you will work with the default Ampere domain. Working with mutliple Ampere instances makes only sense in very complex applications.

Ampere Essentials

Module

  • encapsulates associated states and transitions.
  • splices complex applications in handy units.
  • reusable by other modules
  • provides events
  • configurable

*A good example for an module is an addressbook. You can develop the whole thing completely independent. It might be used as a standalone application. It can be part of another module utilising an addressbook. A module is similar to a Android Intent.

Ampere Essentials

State

  • represents a specific state of your module
  • keeps the data associated with the state
  • contains the logic operating on state data
  • has view(s)
  • configurable

* An example: A state representing an "addressbook list" will keep the addressbook data (the model) and the logic to operate on the data. Logic means functions for create, edit or delete an addressbook entry.

Ampere Essentials

State view

  • the template to display a state
  • controls how to render the state to the screen
  • owned by state

* In most cases a single view is applied to a state. An example for multiple views is a default view and a separate "print" view. If no views were defined by a state, Ampere will generate a default view based on the state definition.

Ampere Essentials

Transition

  • represents the directed route between 2 states
  • is transactional
  • can operate on source and target state data
  • may be reversible (Undo/Redo support)
  • can be disabled depending on custom logic
  • configurable

* The transition is probably the most powerful piece of Ampere. It takes care of the atomicity of transition actions, its reversibility and many more. A typical use case example would be transporting data (the selected address for example) from one state (the "address list") to another.

Ampere Essentials

UI

  • is responsible for rendering the current state of a module
  • has a master layout (builtin: default, wizard and none)
  • owned by module
  • controls and helpers to simplify writing state views
  • consumes ui related options of state, view, module and transition for rendering
  • configurable

* The UI is provided as part of Ampere. You may apply additional controls to the UI. Or even a custom master layout. Master layout use case : Suppose you want to write a wizard - in this case you tell the UI to use the "wizard" master layout.

From Vaporware to Software

  • First papers on Ampere were published in 2002.
  • Ampere technology has gotten reality with its first incarnation in 2003 using Java/Swing/Rhino JS Engine.
  • a new prototype was created in 2007 using Eclipse technology SWT/JFace solving the databinding issue.
  • Todays cutting edge web technologies AngularJS, HTML5, jQuery and Twitter Bootstrap gave a brand new shiny Ampere implementation birth:

jquery.orangevolt-ampere

jquery.orangevolt-ampere

jquery.orangevolt-ampere is a full fledged Ampere implementation for

  • browser
  • desktop
  • and mobile app development

jquery.orangevolt-ampere

Write once, run anywhere
Ă„hem ... Ok, almost anywhere :-)

Browser (FF/Safari/Chrome/IE10/Opera)

Desktop application packaged with node-webkit (Win/OSX/Linux)
Mobile app packaged with Apache Cordova / Phonegap (iOS, Android, Blackberry, Windows Phone etc)

jquery.orangevolt-ampere

jquery.orangevolt-ampere is based on

Stellar Links

It's free

License

jquery.orangevolt-ampere is dual licensed under MIT and GPL2 .

Donations

jquery.orangevolt-ampere is entirely free but if you'd like to support the project you can donate below. Donations will go towards hosting and domain costs.

THE END

BY Lars Gersmann / orangevolt.com