RE: [coldbox:17580] Of Singletons and Transfer of Payload

Sorry for the confusion on that. The Singleton Pattern is a very common pattern in programming:

Here’s the WireBox docs. I just found 4 places in them that described how a singleton is treated :slight_smile:

As for the differences between the singleton scope and the application scope, a singleton is unique to that Wirebox injector but the application scope uses the actual application scope. For most ColdBox apps, there is no difference. However, if your application creates more than one injector inside the same application, there would still only be one application scope, but each injector would have its own internal singleton scope. I would consider that an edge case.

Your service and your DAO should be able to be a singleton. Just make sure you var scope everything so they are thread safe.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform: