Runtime & concurrency
Reveal answer and reasoning
Limit discovery to a known container and a deliberate public static declared-only method set. Read the intended annotation, validate a nonempty unique external name, reject open generic methods and unsupported parameter or return signatures, then create typed delegates for the accepted methods. Sort names only for deterministic presentation. Do not expose every discovered member or let a convenient name bypass the actual callable contract.
Test a valid operation, an unknown route, a duplicate label, an unsupported signature, and a target domain failure. Keep discovery errors distinct from ordinary invocation errors. If metadata inspection alone is sufficient, avoid instantiating arbitrary attribute constructors. The runtime metadata-router project demonstrates the bounded delegate path, while a production extension host would need its own loading and deployment checks. The wrong design chooses the first matching name and assumes any reflection success establishes safety, signature compatibility, or NativeAOT reachability.
What a strong answer covers
- Bound the container and selection flags.
- Validate labels and full signatures before execution.
- Separate discovery, invocation, and deployment failures.
Common pitfall
Exposing arbitrary public methods solely because reflection found them.
Follow-up questions
- Why create a typed delegate after discovery?
- What metadata needs preserving under trimming?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.