Interface IHandler<T>
Chain of Responsibility 패턴 핸들러 계약. SetNext로 체인 연결, Handle로 처리 여부 결정. [규칙] Handle이 true → 처리 완료, 다음 핸들러 호출 안 함. [규칙] Handle이 false → 다음 핸들러로 전달.
public interface IHandler<T>
Type Parameters
T
Methods
Handle(T)
요청 처리. true면 처리 완료, false면 다음으로 전달.
bool Handle(T request)
Parameters
requestT
Returns
- bool
SetNext(IHandler<T>)
다음 핸들러 연결. 체인 구성 시 사용.
IHandler<T> SetNext(IHandler<T> next)
Parameters
nextIHandler<T>
Returns
- IHandler<T>