For the complete documentation index, see llms.txt. This page is also available as Markdown.

Mapping Initiators

Ok, now that we know how to configure WireBox, let's get into the fun stuff of object mapping. How do we do this? By using our DSL mapping initiators that tell WireBox how to start the object registration process. You will then concatenate the initiators with some DSL destinations methods, DI data, etc to tell WireBox all the information it might need to construct, wire and persist the object. Here are the DSL initiators:

Method Signature
Description

map(alias)

The method that starts the mapping process. You pass in a mapping name or a list of names to start registering

forceMap(alias)

Same as map(alias), except it always (re)creates the mapping, overwriting any existing registration for that alias/those aliases. Internally it's just map(alias, force=true)

mapPath(path)

Map a class instantiation path. This method internally delivers a two-fold punch of doing map('CFCFileName').to(path). This is a quick way to map a class instantiation path that uses the name of the class as the mapping name

mapDirectory(packagePath,[include],[exclude], [influence], [filter], [ namespace],[prepend], [process=false])

A cool method that tells WireBox to automatically register ALL the classes found recursively in that instantiation package path. All classes will be registered using their class names as the mapping names and WireBox will inspect all the classes immediately for DI metadata. The include and exclude arguments can be used for inclusions/exclusions lists via regex. The influence argument can be a UDF or closure that will affect the iterating registrations of objects. The filter argument can be a UDF or closure that will filter out or in the classes found, an include/exclude on steroids

unMap(alias)

Unmap/delete a mapping in the binder

with(alias)

This method is a utility method that retrieves the alias mapping so you can start concatenating methods for that specific mapping. Basically putting it into a workable context

Last updated

Was this helpful?