Questions tagged [wirebox]

WireBox is an enterprise ColdFusion dependency injection and AOP framework. It is used in the ColdBox MVC framework, but is also a standalone library that can be used in any ColdFusion application or framework.

Wirebox allows inversion of control (IOC) which decouples dependencies. This allows for independent testing via mocks and stubs.

Docs

8 questions
5
votes
1 answer

How can I make a WireBox injected dependency available to a constructor method?

In this example, I have a model object called test.cfc which has a dependency testService.cfc. test has WireBox inject testService through a property declaration. The object looks like this: component { property name="testService"…
Dave L
  • 3,095
  • 3
  • 16
  • 25
1
vote
1 answer

Coldbox Model Relationships

I feel as though I'm missing something, but the Coldbox documentation is such a mess that I can't seem to find how to create relationships between my models. I have projects, and users. Each a separate table, with a project having a single user…
Robert Gaum
  • 129
  • 1
  • 10
1
vote
1 answer

How to override default dependencies with Mockbox and Wirebox

I have a logger service that has a ScopeStorage and a LoggerServiceDAO dependency and in my unit test I need to override these to use mock objects I have created. I am using Wirebox AOP to trigger the logging events so I can not just create a mock…
Yamaha32088
  • 4,125
  • 9
  • 46
  • 97
1
vote
2 answers

Coldbox getSetting in a model wirebox injection

I am trying to access Coldbox getSetting within a model. In the docs, and on Coldbox Google Group posts, it clearly states The model is a completely isolated layer of your application and has no access to anything ColdBox unless you inject…
Jay Rizzi
  • 4,196
  • 5
  • 42
  • 71
1
vote
0 answers

Wirebox in custom tags

I have some custom tags where I do things like CreateObject(). Some of the tags are used in controllers, some in views. I'd love to use wirebox to inject these dependencies instead. Is there a "right way" to get a reference to the wirebox…
jinglesthula
  • 4,446
  • 4
  • 45
  • 79
0
votes
0 answers

Could not find the ColdFusion component or interface only rarely

In a ColdBox application I have this code in my main handler's onException function: getModel('JVMUtils@cbcommons') In the past month I've seen this throw the error that it can't find it 17 times. During the same time, the application has (sadly)…
jinglesthula
  • 4,446
  • 4
  • 45
  • 79
0
votes
0 answers

WireBox: Map a Java class and immeriately call a method

Is there an easy way to just map the result of createObject("java", "com.intergral.fusionreactor.api.FRAPI").getInstance() to a WireBox alias? Mapping a regular class is easy, but in this case I'd like to keep things clean and just map a singleton…
mz_01
  • 495
  • 3
  • 13
0
votes
1 answer

How do I inject a Coldbox plugin into every handler?

We have some plugins that are used throughout a Coldbox application. Is there a way to globally inject these without having to manually specify the property for each one? I've looked through the Wirebox docs, but can't see anything relevant.…
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176