hexmvc

hexMVC is a powerful MVC+S framework
https://github.com/DoclerLabs/hexMVC

To install, run:

haxelib install hexmvc 0.35.0 

See using Haxelib in Haxelib documentation for more information.

README.md

hexMVC TravisCI Build Status

hexMVC is a powerful MVC+S framework

Find more information about hexMachina on hexmachina.org

Dependencies

Features

Module example with service locator

private class MModule extends Module
{
	public function new( serviceLocator : IStatefulConfig )
	{
		super();
		this._addStatefulConfigs( [serviceLocator] );
		this._addStatelessConfigClasses( [MStatelessCommandConfig, MStatelessModelConfig] );
	}
	
	override private function _getRuntimeDependencies() : IRuntimeDependencies
	{
		var rt = new RuntimeDependencies();
		rd.addMappedDependencies( [ new MappingDefinition( IGitService ) ]); 
		return rt;
	}
	
	override public function _onInitialisation() : Void 
	{
		this._dispatchPrivateMessage( MessageTypeList.TEST, new Request( [new ExecutionPayload( something, ISomething )] ) );
	}
}

Model config

private class MStatelessModelConfig extends StatelessModelConfig
{
	override public function configure() : Void 
	{
		this.map( IMModel, MModel  );
	}
}

Stateful command config

private class MStatefulCommandConfig extends StatefulCommandConfig
{
	public function new()
	{
		super();
	}
	
	override public function configure( injector : IDependencyInjector ) : Void
	{
		super.configure( injector );
		this.map( MessageTypeList.TEST, TestCommand ).once().withGuard( MyGuardClass ).withCompleteHandler( function( e : AsyncCommandEvent ){ trace( e ); } );
	}
}

Asynchronous command example with injections

private class TestCommand extends AsyncCommand implements IAsyncStatelessServiceListener
{
	@Inject
    public var model : IMModel;
	
	@Inject
    public var service : IGitService;

    override public function execute( ?request : Request ) : Void
    {
		this.service.addListener( this );
		this.service.call();
    }
	
	public function onServiceTimeout( service : IAsyncStatelessService ) : Void 
	{
		this._handleFail();
	}
	
	public function onServiceComplete( service : IAsyncStatelessService ) : Void  
	{
		this.model.setValue( service.getResult() );
		this._handleComplete();
	}
	
	public function onServiceFail( service : IAsyncStatelessService ) : Void 
	{
		this._handleFail();
	}
	
	public function onServiceCancel( service : IAsyncStatelessService ) : Void  
	{
		this._handleCancel();
	}
}
Contributors
doclerlabs
Version
0.35.0
Published
7 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub