WireBox : Dependency Injection & AOP
5.x
5.x
  • Introduction
  • Intro
    • Introduction
      • What's New With 5.5.0
      • What's New With 5.4.0
      • What's New With 5.3.0
      • What's New With 5.0.0
      • What's New With 2.1.0
      • What's New With 2.0.0
      • About This Book
      • Author
  • Getting Started
    • Overview
    • Installing WireBox
    • Getting Jiggy Wit It!
      • Instance Creations
      • Binder Introduction
      • Scoping
      • Eager Init
      • How WireBox Resolves Dependencies
  • Configuration
    • Configuring WireBox
      • Binder Configuration Properties
      • Binder Environment Properties
      • ColdBox Enhanced Binder
      • Types & Scopes
      • Data Configuration Settings
      • Programmatic Configuration
    • Mapping DSL
      • Mapping Initiators
      • Mapping Destinations
      • MapDirectory() Influence & Filters
      • Persistence DSL
      • Dependencies DSL
        • Mapping Extra Attributes
      • Mapping DSL Examples
      • Influence Instances at Runtime
      • Processing Mappings
    • Component Annotations
      • Persistence Annotations
      • CacheBox Annotations
    • Parent Object Definitions
  • Usage
    • WireBox Injector
      • Injector Constructor Arguments
      • Injection Idioms
      • Common Methods
    • Injection DSL
      • ID-Model-Empty Namespace
      • Provider Namespace
      • WireBox Namespace
      • CacheBox Namespace
      • EntityService Namespace
      • LogBox Namespace
      • Java Namespace
      • ColdBox Namespace
    • WireBox Event Model
      • WireBox Events
      • WireBox Listeners
        • ColdBox Mode Listener
        • Standalone Mode Listener
  • Advanced Topics
    • Providers
      • Custom Providers
      • toProvider() closures
      • Virtual Provider Injection DSL
      • Virtual Provider Mapping
      • Virtual Provider Lookup Methods
      • Provider onMissingMethod Proxy
      • Scope Widening Injection
    • Virtual Inheritance
    • Runtime Mixins()
    • Object Persistence & Thread Safety
    • ORM Entity Injection
    • WireBox Object Populator
      • populateFromXML
      • populateFromQuery
      • populateFromStruct
      • populateFromQueryWithPrefix
      • populateFromJSON
  • Extending WireBox
    • Custom DSL
      • The DSL Builder Interface
      • Registering a Custom DSL
    • Custom Scopes
      • The Scope Interface
      • Scoping Process
      • Registering a Custom Scope
    • WireBox Injector Interface
  • Aspect Oriented Programming
    • AOP Intro
      • Overview
        • AOP Vocabulary
      • Activate The AOP Listener
      • Create Your Aspect
        • MethodInvocation Useful Methods
        • MethodLogger Aspect
      • Aspect Registration
      • Aspect Binding
      • Auto Aspect Binding
        • ClassMatcher Annotation DSL
        • MethodMatcher Annotation DSL
      • Included Aspects
        • CFTransaction
        • HibernateTransaction
        • MethodLogger
      • Summary
Powered by GitBook
On this page
  • Introduction
  • Release Notes
  • Major Enhancements
  • ColdBox DSL Updates
  • Forced Mappings
  • Dynamic Custom DSL Registration
  • Injection By Type: byType DSL

Was this helpful?

Edit on Git
Export as PDF
  1. Intro
  2. Introduction

What's New With 2.0.0

PreviousWhat's New With 2.1.0NextAbout This Book

Last updated 7 years ago

Was this helpful?

Introduction

WireBox 2.0.0 is a major release of our Dependency Injection and AOP library with some major fixes and some cool new updates.

Release Notes

You can find the release version information here:

Bugs

  • [] -Builder.buildDSLDependency does not use the custom DSL correctly as the default namespace kicks in

Improvements

  • [] -binder.mapDirectory now skips hidden dirs

  • [] -Remove coldbox:cacheManager DSL reference, it is no longer valid

New Features

  • [] -allow mapDSL to be altered at runtime by modules via new wirebox method: registerDSL()

  • [] -Support wiring new injection DSL = byType, which leverages the type to match to an implementation

  • [] -Add a force argument to the map functions so you can override if a mapping already exists

  • [] -New coldbox dsl to get a renderer reference: coldbox:renderer

Major Enhancements

ColdBox DSL Updates

The ColdBox injection DSL has had major updates to get to the ColdBox 4 standards.

  • All ocm injections have been removed in preference to

    cachebox injection DSL

  • The coldbox:cachemanager DSL has been removed in preference to

    cachebox injection DSL

  • All plugin injections have been deprecated in preference to

    model/object injections

  • New coldbox:renderer dsl to inject the new ColdBox system

    renderer

Forced Mappings

The map() function on the Configuration Binder now has a force argument which allows you to map no matter if the mapping exists or not already.

map( alias="MyService", force=true )
    .to( "model.MyService" );

Dynamic Custom DSL Registration

Injectors allow you to register custom DSLs at runtime by using the registerDSL() method on any injector. This feature was mostly done for modules, so they could enhance WireBox in a ColdBox context. However, this also allows you to leverage this in any non-ColdBox applications.

// Register Custom DSL
controller.getWireBox()
    .registerDSL( namespace="javaloader", path="#moduleMapping#.model.JavaLoaderDSL" );

Injection By Type: byType DSL

We have expanded our custom DSL and injectors to allow you to do injection by ColdFusion types. This feature is more in-line with features from Java or static languages were you can tell injectors to inject by argument or property type. Let's say you have a package of interfaces with subpackages of implementations:

/app/pkg/ISomeObject.cfc // <- interface
/app/pkg/adb/SomeObject.cfc // <- component implementing the above interface.
/app/pkg/odb/SomeObject.cfc // <- component implementing the above interface.

You then want to rely on the interface type field of properties in my dependent CFCs and leveraging the byType injection DSL. You would first map the right implementation using the alias as the name of the Interface.

// mappings...
map( "app.pkg.ISomeObject" ).to( "app.pkg.adb.SomeObject" );

// Injection
component {

    /**
     * @inject byType
     */
    property app.pkg.ISomeObject object;

}

All libraries updated

All libraries updated

https://ortussolutions.atlassian.net/browse/WIREBOX/fixforversion/12300
WIREBOX-31
WIREBOX-32
WIREBOX-35
WIREBOX-2
WIREBOX-30
WIREBOX-33
WIREBOX-36
LogBox
CacheBox