FrameworkSuperType: getPlugin method not found, line 151, CB3

I have an object that inherits from FrameworkSuperType, has been for
some time. I'm doing a getMyPlugin() call, which has existed for a
while in this object.

For some reason, when the getMyPlugin() function fires in
FrameworkSuperType, it doesn't seem to be happy with it's own internal
call to controller.getPlugin(). There are several such calls in the
object.

Is it me? Or something new and goofy in 3.0?

- Will B.

First of all,

Why are you inheriting from the super type?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

We inherited from the supertype to have access to common Coldbox
functionality. It seemed like the thing to do at the time, as it
appears to be the lowest level of objects available to our code.

By your question, it sounds as if you don't think this is a good idea.

- WB

You may have heard the oop guideline: "Favour composition over
inheritance". You should think about using coldbox auto-wiring to
inject the plugins you need. I'm on my phone so can't send you the
wiki link, but there is a good guide on there about how to do it with
relevant examples of injecting plugins. Hope that helps :slight_smile:

This may be the URL of interest:

http://wiki.coldbox.org/wiki/Interceptors:AutowireGuide.cfm

I am using the autowire capabilities extensively and find them extremely convenient. I bet you will find it a good alternative to extending the FrameworkSuperType though refactoring your code to use autowiring may be a bit time consuming.

Tom

Yes, not only that, it would seem preferable to talk to the ColdBox factory instead of inheriting to common coldbox classes.

Imagine unit testing your component?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Yes, that's the guide I was referring to - thanks Tom!

One change to note with ColdBox 3 (as I understand it) is that using
the "type" attribute is going to be dropped in favour of a new inject
property. The usage is the same, just replace "type" with "inject" in
your property. Also you no longer require the autowire attribute of
cfcomponent if you have use the autowire interceptor.

Could have not said it better John!!

inject baby, inject!!

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com