Goal: Migrate Bundlingway from tightly-coupled WinForms architecture to a modular Core/UI separation that supports multiple UI frameworks (Blazor, Electron, etc.)
Timeline: 4-6 months (depending on complexity) Approach: Gradual migration with backward compatibility
Target: Week 1-2
Status: ✅ Done (June 16, 2025)
- Create
Core/Interfaces/directory structure - Define
IUserNotificationServiceinterface- AnnounceAsync, ShowErrorAsync, ShowInfoAsync, ShowWarningAsync, ShowSuccessAsync
- ConfirmAsync for user confirmations
- Define
IProgressReporterinterface- StartProgressAsync, UpdateProgressAsync, StopProgressAsync
- Progress event system with ProgressEventArgs
- Define
IConfigurationServiceinterface- LoadAsync, SaveAsync, ResetToDefaultsAsync, ValidateAsync
- Configuration change events
- Define
IPackageServiceinterface- All package lifecycle methods (Onboard, Install, Uninstall, etc.)
- Package operation events
- Define
IFileSystemServiceinterface- All file operations abstracted
- Define
IHttpClientServiceinterface- HTTP operations with progress support
- Define
IApplicationHostinterface- Application lifecycle management
- Create
Core/Services/directory structure - Implement
ConfigurationServiceclass- Async load/save operations
- JSON file persistence using existing extensions
- Configuration validation
- Event firing for changes
- Implement
FileSystemServiceclass- Wrapper around standard .NET file operations
- Implement
HttpClientServiceclass- Progress reporting during downloads
- User agent and header management
- Implement
ServiceLocatorclass- Thread-safe service registration/retrieval
- Service initialization method
- Interim solution for dependency management
- Create
UI/WinForms/directory structure - Implement
WinFormsNotificationService- Bridge to existing form announcement system
- Console fallback for headless mode
- Implement
WinFormsProgressReporter- Integration with existing progress controls
- Console fallback for headless mode
- Create
ModernUIwrapper class- Service-based methods with legacy fallbacks
- Gradual migration support
- Update
Program.csfor service initialization- Early service registration
- Form-aware service updates
- Modern UI initialization
- Create
ARCHITECTURE.mddocumentation - Document new architecture patterns
- Provide migration examples
- Create service usage examples
- Document testing benefits
Target: Week 3-6
Status: ✅ Done (June 17, 2025)
- Create
BundlingwayServiceas migration example- Dependency injection constructor
- GetLocalInfoAsync and GetRemoteInfoAsync methods
- UpdateAsync method with progress reporting
- Service locator integration
- Add modern methods to existing
Bundlingwayhandler- GetRemoteInfoModern() method
- UpdateModern() method
- Test and validate modern methods work correctly
- Benchmark performance difference
- Create
PackageServiceimplementation- Constructor with all required dependencies
- OnboardPackageAsync method (migrate from Package.Onboard)
- InstallPackageAsync method (migrate from Package.Install)
- UninstallPackageAsync method (migrate from Package.Uninstall)
- ScanPackagesAsync method (migrate from Package.Scan)
- Event system for package operations
- Update Package static methods to use service
- Replace direct UI.Announce calls with IUserNotificationService
- Replace Instances.LocalConfigProvider with IConfigurationService
- Replace direct file operations with IFileSystemService
- Replace direct HTTP calls with IHttpClientService
- Test package operations
- Onboarding packages from files
- Installing/uninstalling packages
- Package scanning functionality
- Remove or obsolete static Package handler
- Mark static handler as obsolete and throw NotImplementedException
- Remove all static handler calls from UI and handlers
- Refactor all handler usages to use IPackageService
- Create
ReShadeServiceimplementation - Migrate ReShade.Update method
- Migrate ReShade detection logic
- Replace UI dependencies
- All usages in UI and handlers refactored to use IReShadeService
- Service registered in ServiceLocator and wired in Program.cs
- Static handler is now obsolete and unused
- Create
IGPosingwayServiceinterface - Create
GPosingwayServiceimplementation - Migrate GPosingway.Update method
- Migrate configuration download logic
- Replace UI dependencies
- Create
ICommandLineServiceinterface - Create
CommandLineServiceimplementation - Migrate ProcessAsync logic from static handler
- Replace UI dependencies
- Register and wire up service in Program.cs
- Test CLI functionality without UI
Target: Week 7-10
Status: ✅ Done (June 17, 2025)
- Remove direct
UI._landingreferences from business logic - Remove all static UI dependencies from handlers
- Refactor Bundlingway, GPosingway, and ReShade handlers to use service abstractions
- Remove
_landingfield and all direct references fromUI.cs - Test all handler operations for UI decoupling
- Update
frmLandingto implement view interfaces - Convert direct handler calls to service calls
- Implement proper event handling for service updates
- Remove business logic from form code-behind
- Replace
Instancesstatic class with dependency injection - Replace static
UIclass with service-based approach - Convert remaining static handlers to services
- Implement proper service lifetimes
- Create unit test project
- Add service mocking capabilities
- Create integration tests for core services
- Add handler/service migration tests
Target: Week 11-14
Status: 🚧 In Progress
- Add Microsoft.Extensions.DependencyInjection package
- Refactor Program.cs to use DI container
- Add DI constructor to frmLanding and remove ServiceLocator usage
- Refactor remaining forms/services to use DI
- Remove ServiceLocator from codebase
- Configure service lifetimes (Singleton, Transient, Scoped)
- Implement service registration in startup
- Create service collection extensions
Notes:
- DI container migration started June 17, 2025. ServiceLocator is being phased out in favor of Microsoft.Extensions.DependencyInjection. Program.cs and frmLanding are now DI-based.
- Implement
ApplicationHostclass - Add service coordination logic
- Implement proper startup/shutdown lifecycle
- Add configuration validation on startup
- Create console-based service implementations
- Enable command-line only operation
- Add automated package management scripts
- Test headless scenarios thoroughly
- Environment-specific configurations
- Logging configuration through DI
- Service health checks
- Error handling and recovery strategies
Target: Week 15-20
Status: 📋 Not Started
- Create
Bundlingway.UI.Blazorproject - Create
Bundlingway.UI.Electronproject - Create
Bundlingway.UI.Consoleproject - Set up shared UI contracts
- Set up Blazor Server or WebAssembly project
- Implement Blazor-specific notification service
- Implement Blazor-specific progress reporter
- Create web-based package management interface
- Add real-time updates via SignalR
- Set up Electron.NET project
- Implement Electron-specific services
- Create modern desktop interface
- Add native desktop integration features
- Create command-line interface
- Implement console-based services
- Add scripting and automation support
- Create package management commands
Target: Week 21-24
Status: 📋 Not Started
- Define plugin interfaces
- Implement plugin loading system
- Create extensible package handler system
- Add third-party integration support
- Async/await optimization throughout
- Caching implementations
- Background service improvements
- Memory usage optimization
- Package signature validation
- Secure download verification
- Configuration validation hardening
- Error handling improvements
- Complete API documentation
- User migration guide
- Developer documentation
- Deployment automation
- Core architecture foundation
- Service interfaces and basic implementations
- WinForms bridge services
- Backward compatibility layer
- Service locator pattern
- Documentation and examples
- All Handler classes removed, logic migrated to services
- All static/global state (Instances, IoC, reflection) eliminated
- Service-based, dependency-injected architecture implemented
- Configuration persistence is async
- All business logic decoupled from UI
- Testing infrastructure
- Planning migration to standard DI container
- Warning cleanup: Address all nullable reference and type constraint warnings in the codebase (in progress)
- Update documentation: Ensure all docs and checklists reflect the new architecture and removal of IoC/reflection
- Plan DI container migration: Prepare for migration from ServiceLocator to Microsoft.Extensions.DependencyInjection
- Final runtime verification: Full runtime test to ensure all features work as expected
- Nullable reference warnings in existing code
- Error handling standardization
- Logging consistency across services
- Service Creation: Interface → Implementation → Service Locator registration
- Handler Migration: Create service → Add modern methods → Gradually replace static calls
- UI Bridge: Create UI-specific service implementations
- Backward Compatibility: Wrapper classes with fallback logic
- All new services must have interfaces
- All UI operations must go through service abstractions
- No direct static dependencies in new code
- Unit tests for all new services
- Documentation for all public interfaces
- Zero direct UI calls in business logic
- 100% service interface coverage
- Unit test coverage > 80%
- Successful multi-UI implementation
- All existing features work unchanged
- Headless mode fully functional
- Performance maintained or improved
- Memory usage optimized
- No breaking changes during migration
- Smooth transition between UI frameworks
- Improved error handling and user feedback
- Enhanced automation capabilities
- ✅ Foundation Complete: Clean architecture established
- ✅ First Service Migrated: Package operations working with new pattern
- ✅ UI Decoupled: Business logic runs without WinForms dependencies
- Second UI Working: Blazor or Electron implementation functional
- Production Ready: All features migrated and tested
This checklist will be updated as progress is made. Each completed item should be marked with ✅ and dated.