You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Services are supposed to hide away the implementation details behind a facade and conform to a contract (the interface) This enables us to swap out implementations for tests, workbenches etc. We should add enforcement.
We can do this (enforcement) via Topiarist, but it may need to be updated to expose a way of checking what interfaces a class implements in a more public way. It is possible, it does store a __interfaces__ property right now that we could use.
So, we need to perform a check when a service is registered that that instance provided does implement an interface.
More thought required.
@james-shaw-turner Would you class this as a feature enhancement or a bug?
The text was updated successfully, but these errors were encountered:
I would say it is an enhancement.
As Adam points out if the service is defined as an alias then this is already covered. We could add checking for the case where services are added programmatically but this shouldn't be common usage. So this is relatively low priority
Right now I can register as service as follows:
But the purpose of the ServiceRegistry is (via @james-shaw-turner):
We can do this (enforcement) via Topiarist, but it may need to be updated to expose a way of checking what interfaces a class implements in a more public way. It is possible, it does store a
__interfaces__
property right now that we could use.So, we need to perform a check when a service is registered that that instance provided does implement an interface.
More thought required.
@james-shaw-turner Would you class this as a feature enhancement or a bug?
The text was updated successfully, but these errors were encountered: