In a shared library I have a function that is widely used. I'm implementing a requirement for the function to override its behavior when the entities are in a specific state.
I have decided on implementing this requirement with the decorator pattern.
All of my clinets program against an interface for this service and most of them use a IoC container, others use bastard injection.
How should I force or guide the clients to use my decorator? Without my decorator the service wouldn't do the new requirement for the system.
I was thinking of having the service implementation internal and have a public factory for creating the service as an interface but then my factory couldn't use the lifestyles of the IoC container.
Any suggestions?