-
Notifications
You must be signed in to change notification settings - Fork 0
Structure
The project consists of multiple parts and user interfaces.
-
The core framework - A lightweight and simple framework where you implement commands using a java interface.
-
The bind framework - An aspect-oriented and declarative framework that is based on the core framework.
-
The compile API - A bridge between the core and higher-level abstractions like the bind framework. Unless you want to write an own framework on top of mela-command's core, it is not of major importance.
-
Provided bindings for the bind framework - A standard library of argument mappers and mapping interceptors, covering:
-
Mappers for String, primitive types, generic collections, arrays, maps and a few more
-
Interceptors for flag parameters, optional and default parameters, parameters deduced from context and some validation mechanisms
-
-
A Guice package - Code that each module contributes to in order to make the usage of mela-command in combination with the dependency injection framework Guice very straight-forward.
The core framework is part of every mela-command project. It provides the basic interfaces and structures for any extension and further implementation and all other modules depend on it, but it can also be used directly.
It is simpler and more lightweight than the bind framework, because no additional processing happens before or after command execution. Instead, the arguments are passed in an unprocessed, yet wrapped state.
Main characteristics of the core framework:
-
Simple
-
Lightweight
-
Fast
-
Imperative, Procedural code style
Use the core framework interface directly if your application is very small and its commands only have simple parameter structures.
The compile API is a bridge between the core and any custom framework built on top of it.
A compiler takes an object and creates a set of core commands based on it. The semantics of those transformations depend on the individual implementation. For example, compilers for the bind framework take an object and extract a core command for each command method.
The purpose of the compile API is thus to make the creation of own frameworks that use the core of mela-command possible.
Use and implement the compile API if neither the direct core nor the bind framework can provide the features and structures you need.
- Command Implementation
- Command Groups
- Dispatching Commands
- Command Contexts
- Argument Parsing
- Compile API
- Overview
- Mapper Bindings
- Mapping Interceptor Bindings