Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

LightDomain isn't inheritable #215

Open
@bruno-brant

Description

@bruno-brant

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 of ILightDomain is 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions