Prompt file imported from FuncularLabs/Funcular.FunkyOrm (
.github/prompts/plan-funkyOrmRefactor.prompt.md). Copyright stays with the author.
Plan: Refactor & Polish FunkyOrm for v3.0 Release
I have analyzed the framework and identified several architectural inconsistencies, configuration errors, and code quality issues. This plan outlines the steps to resolve them, ensuring a stable and cleaner v3.0 release.
Steps
- Fix Project Configuration [COMPLETED]: Corrected the invalid
net10.0target inFuncular.Data.Orm.SqlServer.Tests.DotNet10tonet9.0and removed the erroneous<Compile Remove="Visitors\Visitors\**" />from the main csproj. - Establish Core Abstractions [COMPLETED]: Moved
ISqlDataProviderand generic interfaces from the SqlServer project toFuncular.Data.Orm.Core. - Clean Up Extensions [COMPLETED]: Decomposed
ExtensionMethods.cs. Moved generic utilities (AddRange,Contains,ToDictionaryKey, etc.) toFuncular.Data.Orm.Coreand kept SQL-specific extensions in the SqlServer project. - Resolve Technical Debt: Address the
TODOinISqlDataProviderregarding returning the primary key on insert, ensuring the API is complete for v3.0. - Refactor God Class (Time Permitting): Extract connection management logic from
SqlServerOrmDataProvider(2000+ lines) into a dedicatedSqlConnectionManagerto improve testability and SRP. - Fully enable multi-provider support: Your refactoring plan must also include:
- Changing ISqlDataProvider to use IDbConnection or DbConnection instead of SqlConnection.
- Removing the Microsoft.Data.SqlClient package reference from the Core project.
- If Step 5 covers extracting the SQL logic, you are on the right track. The next logical step would be to make the Core interface generic.
Further Considerations
- Breaking Changes: Moving
ISqlDataProviderto a new assembly is a breaking change. Is this acceptable for v3.0? (Assumed Yes for a major version). - Naming: The solution is
FunkyOrmbut namespaces areFuncular.Data.Orm. Do you want to unify this now? (Recommendation: Keep namespaces stable to minimize upgrade pain, unless rebranding). - Testing: The
DotNet10project seems to be a placeholder. Should we retarget it to .NET 9 or remove it? (Recommendation: Retarget to .NET 9).