- Add IModuleProcessor interface defining the processor contract - Implement cProcessor_AppendOnly strategy for modifying existing BOM rows - Implement cProcessor_CloneNew strategy for creating new BOM rows - Add mProcessorFactory module for creating processor instances - Add mSpecAdditionManager module for coordinating spec addition operations - Enhance test suite with business logic layer and pipeline integration tests This implements the Strategy pattern to allow flexible BOM modification behaviors while maintaining clean separation of concerns. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
1.3 KiB
QBasic
27 lines
1.3 KiB
QBasic
' ==============================================================================
|
|
' 模块名称: mProcessorFactory
|
|
' 模块类别: 标准模块 (Standard Module)
|
|
' 模块职责: 负责根据传入的策略类型标识,实例化并返回对应的业务策略对象
|
|
' ==============================================================================
|
|
Option Explicit
|
|
|
|
' ------------------------------------------------------------------------------
|
|
' 函数名称: GetProcessor
|
|
' 函数功能: 根据策略别名,返回对应的 IModuleProcessor 实现类
|
|
' 参数说明: strategyType - 策略标识 (例如 "APPEND" 或 "CLONE")
|
|
' ------------------------------------------------------------------------------
|
|
Public Function GetProcessor(ByVal strategyType As String) As IModuleProcessor
|
|
Select Case UCase(Trim(strategyType))
|
|
Case "APPEND"
|
|
' 返回追加策略实例
|
|
Set GetProcessor = New cProcessor_AppendOnly
|
|
|
|
Case "CLONE"
|
|
' 返回克隆新增策略实例
|
|
Set GetProcessor = New cProcessor_CloneNew
|
|
|
|
Case Else
|
|
' 如果传入了未知的策略,主动抛出异常阻断运行
|
|
Err.Raise vbObjectError + 513, "ProcessorFactory", "未知的业务处理策略: " & strategyType
|
|
End Select
|
|
End Function |