- Rename Helper class to FormatHelper for clarity
- Add comprehensive XML documentation
- Update all references in BinFileSaver, ArchUnits, and Bin
- Remove unused System.Drawing import
- Better method documentation explaining parameters and return values
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Convert CutList.csproj to SDK-style project format
- Convert SawCut.csproj to SDK-style project format
- Remove obsolete packages.config files (now using PackageReference)
- Remove App.config (not needed in .NET 8)
- Update package references to use SDK-style format
- Enable nullable reference types and implicit usings
- Preserve publishing configuration for network deployment
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Introduce Model-View-Presenter pattern to eliminate business
logic from MainForm and enable proper separation of concerns.
New files:
- IMainView: Interface defining view contract
- MainFormPresenter: Contains all business logic orchestration
MainForm changes:
- Implements IMainView interface
- Delegates all business logic to presenter
- Focused purely on UI rendering and user input
- MessageBox calls now isolated to view implementation
Presenter responsibilities:
- Document operations (open, save, new)
- Validation orchestration
- Running packing algorithm
- Coordinating between services and view
- State management
Benefits:
- MainForm reduced from 380+ lines to clean view implementation
- Presenter can be unit tested without UI
- Business logic is reusable across different UI frameworks
- Clear separation: View = UI, Presenter = logic, Services = domain
- All SOLID principles now satisfied
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Refactor DocumentService and CutListService to return Result<T>
instead of throwing exceptions or using out parameters. This
removes all MessageBox calls from business logic.
DocumentService changes:
- Load() returns Result<Document> instead of Document
- Save() returns Result instead of void
- Validate() returns Result instead of bool with out parameter
- All exceptions caught and converted to Result.Failure
CutListService changes:
- Pack() returns Result<SawCut.Nesting.Result>
- Exceptions caught and converted to Result.Failure
Benefits:
- Services are now UI-agnostic (no MessageBox)
- Can be unit tested without UI dependencies
- Can be reused in console apps, web apps, etc.
- Errors are values, not exceptions
- Clear, type-safe error handling contract
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace hard-coded engine instantiation with factory pattern
to enable dependency injection and improve testability.
Changes:
- IEngineFactory: Interface for creating engines
- EngineFactory: Default implementation using AdvancedFitEngine
- MultiBinEngine: Now accepts IEngineFactory via constructor
This eliminates the hard-coded dependency on AdvancedFitEngine
and allows for easy swapping of engine implementations through
configuration or dependency injection.
Benefits:
- Dependency inversion principle satisfied
- Engines can be mocked in tests
- Engine selection can be configured externally
- Single responsibility for engine creation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement Result<T> and Result classes to provide type-safe,
functional error handling throughout the application. This
eliminates the need for exceptions as control flow and provides
a consistent way to communicate success/failure.
Features:
- Result<T> for operations that return values
- Result for operations without return values
- Map() method for functional composition
- IsSuccess/IsFailure properties for easy checking
This pattern enables cleaner service contracts and eliminates
the need for out parameters and exception handling boilerplate.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Create CutListService and DocumentService to separate business
logic from UI concerns, following the service layer pattern.
Changes:
- CutListService: Handles bin packing algorithm orchestration
and data transformation from UI models to domain models
- DocumentService: Handles document persistence and validation
- Document: Removed Save/Load/Validate methods (now pure POCO)
- MainForm: Refactored to delegate to service classes instead
of containing business logic directly
Benefits:
- Improved separation of concerns
- Business logic can now be unit tested independently
- Removed MessageBox dependencies from business logic layer
- MainForm is now focused on UI concerns only
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace public mutable collection fields/properties with private
backing fields and expose them as IReadOnlyList. Add proper methods
for mutation (AddItem, AddItems, RemoveItem, SortItems).
Changes:
- Bin.Items: Now private with AddItem/AddItems/RemoveItem/SortItems
- Result.ItemsNotUsed: Now readonly with Add methods
- Result.Bins: Now readonly with Add methods
- Updated all engine classes to use new encapsulated APIs
This improves encapsulation and prevents external code from
bypassing business logic by directly manipulating collections.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove empty catch-and-rethrow blocks in Load() and Save() methods
that were catching exceptions only to rethrow them without adding
any value. This improves code clarity and exception propagation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove dangerous side effect where the Length property getter
was modifying the LengthInputValue field. Property getters should
be pure and not cause state mutations, as this violates the principle
of least surprise and can cause issues with data binding, serialization,
and debugging.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>