Description
The intention is to only segregate the DOMAIN from the IMPLEMENTATIONS to simplify the extensibilities. All the existing objects and namespaces will not be affected even if they are moved to the new packages. There should be no code changes on the consumer side.
Describe the request
As the library is growing bigger and slowly becoming more complex than it was, it was likely (or better) to have the objects separated into multiple Nuget packages.
Basically, the UNION architecture is a better option on this scenario, in which, the DOMAIN and the IMPLEMENTATIONS are separated into multiple packages and simplify the reusability of the components.
Think of this, the library is most likely consisting the following segregations in terms of features and capabilities.
- Core/Basic/Domain
- Operations
- Specializations (Tracing/Logging, Caching, Event Handling, etc)
- Extensions
Describe your wish
As we see it, there should be the following Nuget Packages.
- RepoDb.Domain
- RepoDb.Domain.<Cache|Trace|Operations|Specializations|Extensions>
- RepoDb (better if RepoDb.Core) - (THE MAIN PACKAGE)
- RepoDb.Operations
- RepoDb.SqlServer
- RepoDb.SqlServer.BulkOperations
- RepoDb.PostgreSql
- RepoDb.PostgreSql.BulkOperations
- RepoDb.MySql
- RepoDb.MySqlConnector
- RepoDb.Sqlite.Microsoft
- RepoDb.SQLite.System
- RepoDb.Extensions
- RepoDb.Extensions.<SqlServer|PostgreSql|MySql|MySqlConnector|Sqlite|SQLite>
So, considering the following scenarios, you most likely have to only install the following to maintain the lightweight(ness) of the application.
Only if RawSQL (Execute Methods)
- RepoDb.Domain
- RepoDb
Only if Operations (Query, Insert, Merge, Update, Delete)
- RepoDb.Domain
- RepoDb
- RepoDb.Operations
If with Tracing
- RepoDb.Trace
If with Caching
- RepoDb.Caching
If with Specific DB Providers
- RepoDb.SqlServer or RepoDb.<PostgreSql/MySql/MySqlConnector/Sqlite/SQLite>
If with SQL Server BulkOperations
- RepoDb.SqlServer.BulkOperations
And many more.
Rationale
With these, we are not required anymore to install everything at once and can always extend the library targeting the objects residing on the RepoDb.Domain or RepoDb.Domain.* package.
Example: The newly created Query Field objects under the namespace (RepoDb.Extensions.QueryFields). Theses object are best if being placed on the new package named RepoDb.Extensions, however, the implementation is not ideal as they directly inherits the QueryField object from the RepoDb main package, in which architecturally should reside on the RepoDb.Domain.
Creating a new extension package that references the core package is not advisable as it enable the developers to just install the extension and everything would like like a charm (which is truly a big mistake).
And, there a lot more of scenarios.
Advantages
Simplicity on the maintenance and extensibilities in all areas. This is given with UNION architecture or the similar.
The application is only referencing the required libraries to run the needed feature and capabilities, with this, the application is more lightweight as it should.
Note: Though, in general, the RepoDb library is still very lightweight.
Drawback
Complexity on referencing the different features and capabilities. If you required the full features, you may ended-up referencing too many Nuget packages.
Practically, as the library author, I have a feeling (instinct) that this may annoyed the users at some point as it sound not too practical to separate the capabilities/functionalities into multiple packages if you are using an OSS library like an ORM.