Files
CutList/SawCut/Nesting/IEngineFactory.cs
AJ ee5c20bc8b Add factory pattern for engine creation
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>
2025-11-18 17:43:22 -05:00

19 lines
737 B
C#

namespace SawCut.Nesting
{
/// <summary>
/// Factory interface for creating bin packing engines.
/// Allows for dependency injection and testing without hard-coded engine types.
/// </summary>
public interface IEngineFactory
{
/// <summary>
/// Creates a configured engine instance for bin packing.
/// </summary>
/// <param name="stockLength">The length of stock bins</param>
/// <param name="spacing">The spacing/kerf between items</param>
/// <param name="maxBinCount">Maximum number of bins to create</param>
/// <returns>A configured IEngine instance</returns>
IEngine CreateEngine(double stockLength, double spacing, int maxBinCount);
}
}