Docs Code Cookbook

Code Cookbook


hexMVC

MVC implementation for writing individual modules with the classical Model-View-Controller structural pattern. Lightweight experimental MVP is provided as well.


Module example with service locator


Model config


Stateful command config


Asynchronous command example with injections

Show more »


hexIoC

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


Parsing DSL at compile-time


Parsing DSL at runtime


Simple example


Building dynamic object


Passing arguments to constructor


Injection by using references


Injection and method call


Singleton instantiation


Factory instantiation


Factory instantiation using singleton


XML type parsed


Array containing references


Building an HashMap


Module listening another module


Module listening another module with adapter strategy


Class reference


Building a service locator


Building a mapping configuration with mapped service classes


Module listening a service


State machine configuration


Module listening service with adapter strategy and module injections


Redefining application context class


Listening application context states changes


Conditional parsing



Preprocessing



Include


Read xml at compile time with preprocessing

Show more »


hexDSL

DSL toolkit




hexInject

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


Simple example


Properties injection


Constructor injections with one named and optional


Method injections with named dependencies


Postconstruct methods


Predestroy methods

Show more »


hexUnit

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


How to run framework tests inside the browser


How to run tests with NodeJS (you can mix tests classes with suites)


How to test only one method


Suite example (you can mix tests classes with suites)


Test example


Asynchronous test example

Show more »


hexService

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


Simple HTTP Service

Show more »


hexAnnotation

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


Simple example

Show more »


hexReflection

Fast class description builder to output lightweight reflection data and replace rtti (class description parsing at compile time)




hexState

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.


Simple example

Show more »


hexCore

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


Dispatcher example


EventDispatcher example


Simple logger example


Logger example with proxy layout


Locator example

Show more »