Skip to content
thofrey edited this page Jul 23, 2013 · 24 revisions

Installation

Quick Reference

Mach-II Concepts and Introductions

Bootstrappers

The bootstrapper is what connects a Mach-II application to CFML engine usually via Application.cfc.

Using the Application.cfc Bootstrapper

Event

Mach-II is event-driven. The event object is at the heart of the Mach-II request lifecycle. Mach-II automatically puts all the form and URL variables from the current request into the event object, and your application can also programmatically put data into and pull data from the event object. The ability to access everything from a single event object is an extremely convenient way to deal with the event's data.

Listeners and Call-Method

Listeners are the "connecting tissue" between Mach-II and your model by acting as a "proxy" or "gateway". They capture events that are defined in your configuration file, interact with your model and pass data back to the framework.

Introduction to Listeners

Often when writing Mach II applications the developer is required to create a method in a listener that simply calls a method in the application's service layer with out any additional logic. This requires the developer to write extra listener methods that don't really serve any purpose. Mach II makes this easier by providing the call-method command which allow the framework to call a method in the service layer and optionally put the result in a event argument.

Using the Call-Method Command

Properties

Properties in Mach-II applications are a convenient way to make variables available throughout an entire Mach-II application. Properties are declared in mach-ii.xml and after the application initializes, properties may be accessed via a simple getProperty() method call from anywhere within the application, including within all Mach-II object types (Listeners, Filters, Plugins) as well as in views. In addition to declaring properties in mach-ii.xml, they may also be added to Mach-II's property manager programmatically.

Introduction to Properties

Filters

Filters enable per-event flow control in Mach-II applications. A simple example would be the addition of security or logging to a specific Mach-II event, or conditionally redirecting to a different event based on some value. By developing a filter and adding this filter to the event, this additional functionality can be added to or removed from the event without touching the business logic involved.

Introduction to Event-Filters

Plugins

A plugin is a developer-defined CFC that extends the Mach-II framework. The plugin architecture provides robust extensibility for plugin point for cross-cutting event actions. This means each defined plugin point fires on every request and matching point area. Plugins are useful for executing application wide business login such as loading locale resource bundles before views, checking that the request is secured through SSL or loading specific args into the eventobject on each request.

Introduction to Plugins

Logging

The logging package gives developers a full blown logging package with several bundled loggers and the extensibility to meet all needs through customized loggers. The logging package allows you to logs exactly what happens for each request lifecycle and the ability output and use the logging data in a multitude of ways.

Introduction to Logging

Caching

Mach-II comes bundled with an advanced, powerful and flexible caching package that is easy to configure and use. The caching system allows you to cache partial HTML snippets and data through simple XML tags in your configuration file to allowing you complete control and access to when and how to cache your data.

Introduction to Caching

The View Layer

The view is a layer where Mach-II offers developers a lot of assistance from bindable form library, using resources like images/Javascript/CSS and managing view specific metadata.

Managing URLs

URL Management Features

Endpoints

In all simplicity, endpoints are simple and lightweight "servlet" like handlers that accept requests and respond to them as required. Most endpoints will be used for non-human interactions, they are purposedly designed to be lightweight, and singular in purpose by performing without the need of plugins, filters, subroutines or other Mach-II constructs that the full Mach-II request lifecycle provides.

Endpoint Overview

Modules, Includes and Subroutines

A Mach-II module is an application which runs inside of a parent Mach-II application. A module usually groups together common functionality in to a related package, encapsulates that package nicely within your Mach-II app, and inherits a lot of the base configuration from the parent Mach-II application. Some people build Mach-II modules that are meant to be reused across multiple applications, for multiple sites, while others build open-source modules which are meant to be redistributable and used by anyone, anywhere.

Introduction to Modules

Includes allow you include other Mach-II configuration files and helps developers break up the configuration into logical chunks but doesn't completely address building applications in a more modular fashion.

Introduction to Includes

Subroutines allow you to "reuse" snippets of XML in an effort to reduce redundancy in the configuration file. When a subroutine is executed, it would execute XML commands in the subroutine immediately instead of announcing an event which is queued.

Introduction to Subroutines

Exception Handling

Internationalization / Globalization (i18n / g11n)

Utilities and Toolkit

Pattern Matching

Mach-II comes bundled with utilities that can help you do perform complex pattern matching on strings, paths and files.

Development Utilities

Using Advanced Features and Utilities

Implementation and Design Questions

Project Information

What's New…

Common Architectural Approaches

Behind the Scenes in Mach-II

Performance and Debugging

Common Errors

Clone this wiki locally