RE: Re: Re: Re: [coldbox:19943] Coldbox 3.7.0: Modeldecorator depending on rc.Service

If your question object is accessed by more than one thread (singleton, etc) do not overwrite a shared variable in your setService method.

The controller error is coming from the getModel() method inherited from the framework supertype. I’ve never seen that before. You’re not directly creating instances of these handlers are you? When in the lifecycle of that handler is the setService method being called:

> I would also need to load Service dynamically in a Model.

This works in the same manner as the handler, but models don’t inherit from the framework supertype and therefore don’t have a getModel() method available to you. What you will want to do is inject WireBox and do wirebox.getinstance(“serviceName”)

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com