wirebox-aop

Enable Aspect-Oriented Programming for WireBox and ColdBox applications.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill wirebox-aop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wirebox-aop
Source: https://github.com/ColdBox/skills/tree/main/coldbox/wirebox-aop
Command: npx skills add https://github.com/ColdBox/skills --skill wirebox-aop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers apply cross-cutting concerns such as logging, transactions, security, caching, and tracing to methods without modifying business code, reducing duplication and centralizing cross-cutting logic.

Core Features & Use Cases

  • Aspect creation: Implement MethodInterceptor aspects with full WireBox dependency injection and implement invokeMethod with proper proceed semantics.
  • Registration & binding: Register aspects with mapAspect, bind them using bindAspect with the Matcher DSL, or rely on classMatcher/methodMatcher annotations for auto-binding.
  • Built-in support: Leverage ready-made CFTransaction, HibernateTransaction, and MethodLogger aspects for transactional and logging needs.
  • Use case: Add transactional boundaries and centralized logging to service layer methods across a ColdBox or standalone WireBox application.

Quick Start

Enable the Mixer listener in your WireBox binder, map a MethodLogger aspect, and bind it to the target service classes to log method calls and results.

Frequently Asked Questions about wirebox-aop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add logging and transactions to service layer methods without modifying business code?

Aspect-oriented programming applies cross-cutting concerns like logging and transactions to methods without modifying business code. You create MethodInterceptor aspects, register them with WireBox, and bind them to target classes using the Matcher DSL to centralize logic and reduce duplication.

How do I implement a method interceptor in WireBox that runs logic before and after a method call?

Implement a method interceptor by creating a MethodInterceptor component, enabling the Mixer listener in your WireBox binder, and writing an invokeMethod function that calls proceed() to execute the original method while applying your custom logic before and after execution.

Can I use built-in transaction and logging aspects in ColdBox instead of writing custom interceptors?

Yes, WireBox provides ready-made CFTransaction, HibernateTransaction, and MethodLogger aspects for transactional boundaries and logging needs. You can map and bind these built-in aspects directly to your service classes using the bindAspect API and Matcher DSL.

Does WireBox support annotation-based auto-binding for aspect-oriented programming?

Yes, WireBox supports annotation-based auto-binding through classMatcher and methodMatcher annotations. This allows you to automatically bind aspects to matching classes and methods during dependency injection and runtime without explicitly calling bindAspect for each target.

What is the best way to apply cross-cutting concerns like security and caching across a ColdBox application?

The best way to apply cross-cutting concerns like security and caching across a ColdBox application is using WireBox aspect-oriented programming. Register aspects with mapAspect, bind them using the Matcher DSL, and leverage dependency injection to centralize logic without duplicating code.

Can I use WireBox aspects in a standalone application without the full ColdBox framework?

Yes, aspect-oriented programming works with standalone WireBox binders as well as full ColdBox configurations. You enable the Mixer listener in your WireBox binder and use the same mapAspect and bindAspect APIs to create, register, and bind MethodInterceptor aspects to your classes.