Skip to content

Allow multiple HandlerOrder attributes on a single handler class #3

Description

@Skymly

Summary

Enable one handler class to participate in multiple generated pipelines by applying multiple [HandlerOrder] / [HandlerOrder<TContext>] attributes (different context types and/or orders).

Motivation

Strategy and Factory already use AllowMultiple = true. Handler is the outlier: shared cross-cutting handlers (logging, telemetry) should register on more than one IHandler<TContext> pipeline without duplicating types.

Acceptance criteria

  • HandlerOrderAttribute and HandlerOrderAttribute<TContext> use AllowMultiple = true
  • HandlerOrderGenerator emits one registration per attribute instance; pipelines are still grouped by context type
  • Existing duplicate-order (DP005), contract mismatch (DP008), and parameterless constructor (DP009) diagnostics unchanged
  • Generator Verify test + integration test for one class with two contexts
  • Document in docs/ChainOfResponsibility.md; update docs/ROADMAP.md

Module

DesignPatterns/ (attributes) + DesignPatterns.SourceGenerators/ + tests/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions