Extend Handler-A to Handler-B

Hi there,

Is it possible to extend Handler-A to Handler-B, with the idea to
access Handler-B functions from Handler-A

Thank you guys

Could you move the functionality out of the handler and into some type
of service object? Then both handlers could access functions from the
service object.

- Gabriel

Thank you Dorioo, That sounds great, can you defineme a "service
object" in coldbox.

Thank you

Well, it's not a coldbox specific thing but the idea is that you want
code to that is shared to exist in a model object (for example, the
service object I referenced) or maybe even a plugin. So instead of the
function existing in handler B, it would exist in a plugin or model
object. You'd then inject that object into your handler. And the both
B and A would have access to those functions.

If you look at the sample application "simple_blog_5" >> handlers >>
blog.cfc, you'll see that it has an object called "entryService"
injected into it. The "entries" event then calls
"entryService.getLatestEntries()". If I had a second handler somewhere
else that needed that same functionality, I'd inject the service into
my second handler and call "entryService.getLatestEntries()" to get
the same functionality.

- Gabriel

Got it... thanks, again!