Open bruno-brant opened 4 years ago
LightDomain uses a trick to restrict inheritance:
LightDomain
https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Domain/Base/Domain/LightDomain.cs#L30
This means that users of our code can't direct inherit this class. No matter right? Maybe they should implement ILightDomain, and use that instead...
ILightDomain
https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Activation/Worker/LightWorker.cs#L168
https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Activation/Controller/LightController.cs#L44
They can't, because the frameworks requires instances of LightDomain. In fact, a quick search show us that the only usage of ILightDomain is FactoryDomain:
FactoryDomain
https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Domain/Base/Domain/LightDomain.cs#L166
But one can clearly see that the cast could be safely dropped (T is restricted to be LightDomain which is ILightDomain).
Not sure what to call this, bug, enhancement, pure madness...
LightDomain
uses a trick to restrict inheritance:https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Domain/Base/Domain/LightDomain.cs#L30
This means that users of our code can't direct inherit this class. No matter right? Maybe they should implement
ILightDomain
, and use that instead...https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Activation/Worker/LightWorker.cs#L168
https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Activation/Controller/LightController.cs#L44
They can't, because the frameworks requires instances of
LightDomain
. In fact, a quick search show us that the only usage ofILightDomain
isFactoryDomain
:https://github.com/Avanade/Liquid-Application-Framework/blob/41cc17fc02659ff70660accdc8ad7c3b8ea4ae5a/src/Liquid.Domain/Base/Domain/LightDomain.cs#L166
But one can clearly see that the cast could be safely dropped (T is restricted to be LightDomain which is
ILightDomain
).