Suggestion: Modules & Features #419
MikaelHild
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I'm fine with it as long as it is simple and does not set us a slippery slope towards ABP hell |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Modules
I often have projects where I have to integrate external systems using their API's.
In order to base and continue development on e.g. FSH it would be awesome if the system would support modules so that the external system parts could be added as an infrastructure project and/or as an application project.
The FSH could offer a base class or an interface to inherit from, such as IFSHModule with some methods; PreInitializeModule, ConfigureModuleServices and PostInitializeModule.
Upon startup the assembly is scanned for Modules having the IFSHModule interface and then call the methods in the order above.
With support from the above, it's possible to create an integration for i.e. twitter, where you have the Infrastructure.Twitter module that handles reading twitter feeds and then an Application.Twitter module exposing an API using ApplicationParts to automatically register and expose some application API's to get the twitter feeds from the client.
The infrastructure project could also have it's own DbContext, only exposing tables associated with the twitter entities. E.g. for saving the most liked tweets.
I think it's in a way similar to the Monolithic Architecture described in Mukesh blog article that can be found here:
https://codewithmukesh.com/blog/modular-architecture-in-aspnet-core/
Some possible problems are handling dependencies and
Features
With modules it's possible to extend the application and therefor it would be nice to have a feature API in the core of the application. With the module in place, the module could register some global, tenant and perhaps user features where global features would affect all tenants, tenant features would only affect the current tenant and user features would only affect single users.
Microsoft have a featuremanagement project for this purpose that supports features using the IConfiguration interface but also provides a IFeatureDefinitionProvider where you could load features from a feature store or an API.
https://github.com/microsoft/FeatureManagement-Dotnet
Depending on the feature, it could provide client information if a feature is enabled or disabled, if some menu, tab or function should work, be visible or be hidden. There's also a possibility to Guard API's based on if a feature is enabled or disabled, if there's a restriction on how many brands you may have, if the dashboard feature is enabled or disabled in the system etc.
Some examples: https://hamedfathi.me/a-professional-asp.net-core-api-feature-management/
What do you guys think?
Beta Was this translation helpful? Give feedback.
All reactions