What is it for?

For building configurable, large scaling modular applications, games, stateful websites and servers, targeting JavaScript, Flash, PHP, Neko platforms.
hexMachina is OpenSource, free to use and collaborate.

Want to learn more?

Join the Community
hexMachina Forums
Check Github repositories
Github hexMachina
Get started
hexMachina Documentation
Follow our blog
hexMachina Blog

Features of the framework

hexMachina relies on a smart mix beetween declarative and imperative programming. The main concept is to split your application codebase in two distinct parts. The first one is made from resusable micro-applications called components developed with haxe language. The second one is driven by DSL for describing your components assembling and your application behaviors.


MVC implementation for writing individual modules with the classical Model-View-Controller structural pattern.

class MyModule extends Module {
    public function new( view:IMyView ) {
        this.buildViewHelper(MyViewHelper, view);

private class MyModuleCommandConfig extends StatelessCommandConfig {
    override public function configure() {
        this.map(MyModuleMessage.MODULE_READY, InitModuleMacro).once();
        this.map(MyModuleMessage.GET_NEWS, GetNewsCommand);

Inversion of Control system to make multi-modular applications. You can have an extremely powerful DSL layer (Domain Specific Language), where you can connect together any modules, components and describe any dependency, behavior between them.

<module id="myModule" type="myproject.module.mymodule.MyModule">
    <listen ref="myService">
        <event static-ref="myproject.myservice.MyServiceMessage.FIRE" method="setFire"/>

<service id="myService" type="myproject.service.myservice.MyService">
    <property name="myprop" value="15" />

Powerful and easy-to-use Dependency Injection system based on @annotations. It supports property, method and constructor injections predefined in injector mappings.

class MyClass {
    public var myProperty:IConcreteDependecy;

    @Inject( "myName1" )
    public var property1 : String;

    public function myFunction( dep : Clazz, dep2 : ISomeInterface ) {
        // function body

Extendable UnitTest runner with a basic set of assertions. It works well together with any mocking and assertion system. JUnit and FlexUnit like syntax.

class MyTest {
    var service:IMyService;

    public function setUp() {
        this.service = new MyServiceMock();

    @Test("Test sum method")
    public function testAdd() {
        Assert.equals( 8, service.add( 3, 5 ), "Sum of 3+5 should be 8" );

Service layer extension for hexMVC to separate service communications. It has all typical predefined service behaviors like: configuration, success, fail, cancel, timeout, etc.

var service = new MyService ();
service.addHandler (StatelessServiceMessage.COMPLETE, function () {
    trace ("complete");

Easy-to-use utilities for reading and writing @annotation data.

class MyAnnotations implements IMyAnnotation {
    @MyAnnotation( "yes" )
    var annotated : String;

    @Language( "en" )
    function doTest( i : Int ) : Void {

Powerful easy-to-use StateMachina system based on Martin Dowler’s implementation. It saves you from a lot of issue with invalid states of your application.

var logAsUser = new MessageType( "onLogin" );

var anonymous = new State( "anonymous" );
var user = new State( "user" );

var stateMachine = new StateMachine( anonymous );
var controller = new StateController( injector, stateMachine );

anonymous.addTransition( logAsUser, user);

user.addEnterCommand( DisplayWelcomeCommand );

controller.handleMessage( logAsUser );

Common core libraries that everyone needs in everyday developments like: exceptions, dispatcher, logging system, utils, etc.

Logger.getInstance().setLevel( LogLevel.DEBUG );
Logger.getInstance().addListener( new TraceLayout() );
Logger.DEBUG( "test" );

var onTest = new MessageType( "onTest" );
var dispatcher = new ClosureDispatcher();
dispatcher.addHandler( onTest, function () {
    trace( "onTest" );
} );
dispatcher.dispatch( onTest, [] );



Haxe Summit 2018 - Consuming injections with minimal dependencies

Find below the video and slide for Francis’s talk about hexInject at Haxe Summit 2018 in Seattle.

Read more »

Haxe Summit 2018 - A deep dive into hexUnit

Find below the video for Laurent’s talk about hexUnit at Haxe Summit 2018 in Seattle.

Read more »

Haxe Summit 2017 - A deep dive into hexInject

Find below the video for Stepan’s workshop about hexInject at Haxe Summit 2017 in Amsterdam.

Read more »

Haxe Summit 2017 - A deep dive into hexDSL

Find below the video for Laurent’s workshop about hexDSL at Haxe Summit 2017 in Amsterdam.

Read more »