Refactor strategy pattern to implement separation of concerns
- Update IModuleProcessor interface to accept targetBOMs collection instead of targetItemName string - Remove filtering logic from strategy implementations (AppendOnly, CloneNew) - Add LoadData method to mSpecAdditionManager for UI initialization - Rename ExecuteAddition to ExecutePipeline with refined parameters - Enhance test suite to simulate fine-grained UI selection behavior - Enable precise row-level control by delegating filtering to UI layer This refactoring achieves better separation of concerns where: - Strategy layer focuses purely on execution logic - UI layer handles selection and filtering - Manager layer coordinates the pipeline flow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
' ==============================================================================
|
||||
' 模块名称: IModuleProcessor
|
||||
' 模块类别: 类模块 (用作接口 Interface)
|
||||
' 模块职责: 定义统一的业务处理接口,基于UI用户选择的物料名称进行精准处理
|
||||
' 模块职责: 定义统一的业务处理接口。此时的策略层已完全解耦,不关心过滤逻辑。
|
||||
' ==============================================================================
|
||||
Option Explicit
|
||||
|
||||
' 方法名: ProcessSpec
|
||||
' allBOMs: 包含所有物料信息的集合 (库里的所有数据)
|
||||
' targetItemName: 要被处理的物料的名称字段 (瞄准镜)
|
||||
' paramName: 参数名(如 lcfw)
|
||||
' newValue: 新规格代码(如 M19)
|
||||
' engine: 条件注入引擎实例
|
||||
Public Sub ProcessSpec(ByRef allBOMs As Collection, ByVal targetItemName As String, ByVal paramName As String, ByVal newValue As String, ByRef engine As cConditionEngine)
|
||||
' allBOMs: 总库集合 (主要用于克隆策略追加新行)
|
||||
' targetBOMs: 由UI层(或中枢)精挑细选出来的目标行集合 (手术对象)
|
||||
' paramName: 参数名(如 lcfw)
|
||||
' newValue: 新规格代码(如 M19)
|
||||
' engine: 条件注入引擎实例
|
||||
Public Sub ProcessSpec( _
|
||||
ByRef allBOMs As Collection, _
|
||||
ByRef targetBOMs As Collection, _
|
||||
ByVal paramName As String, _
|
||||
ByVal newValue As String, _
|
||||
ByRef engine As cConditionEngine)
|
||||
|
||||
' 接口中不写任何实现代码
|
||||
End Sub
|
||||
Reference in New Issue
Block a user