Skip to content

Upgrade to 0.2.0-preview2 + add guard/tracing/async/pooling samples#15

Merged
Skymly merged 1 commit into
mainfrom
feature/samples-sync-020-preview2
Jun 28, 2026
Merged

Upgrade to 0.2.0-preview2 + add guard/tracing/async/pooling samples#15
Skymly merged 1 commit into
mainfrom
feature/samples-sync-020-preview2

Conversation

@Skymly

@Skymly Skymly commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Bump DesignPatternsPackageVersion from 0.1.0-preview6 to 0.2.0-preview2 and add new feature demonstrations across 5 samples to cover the 0.2.0-preview1/2 feature set.

Strategy

  • Guard predicate on AlipayPayment ([RegisterStrategy(Guard=)])
  • TryGetWithGuard runtime resolution
  • ExecuteTracedAsync with StrategyExecutionTrace (status, timing)
  • KeyNotFound trace for missing keys

Chain

  • InvokeTracedAsync with per-step status display
  • Exception observability: ThrowingHandler + IHandlerExceptionObserver
  • Failed status captured in trace before re-throw

Factory

  • Async factory registry (IAsyncFactoryRegistry + CreateAsync)
  • Pooled factory registry (IPooledFactoryRegistry with RentAsync/Return)
  • PooledBuffer product implementing IResettable

State

  • Entry/exit actions on [Transition] (OnEnter/OnExit attributes)
  • IStateMachine instance wrapper with CurrentState tracking
  • TryTransitionAsync firing entry/exit actions
  • TryTransitionTracedAsync with TransitionTrace observability

EventAggregator

  • Error isolation via ContinueOnError on PublishTracedAsync
  • FailingHandler demonstrating exception capture
  • EventPublicationTrace with HasFailures and per-step status

README

Updated the projects table to reflect new sample capabilities.

Test plan

  • dotnet build DesignPatterns.Samples.slnx -c Release passes (exit 0)
  • CI pipeline passes on all target frameworks
  • Visual review of sample output (dotnet run for each modified sample)

Bump DesignPatternsPackageVersion from 0.1.0-preview6 to 0.2.0-preview2.

New feature demonstrations across 5 samples:

Strategy:
- Guard predicate on AlipayPayment ([RegisterStrategy(Guard=)])
- TryGetWithGuard runtime resolution
- ExecuteTracedAsync with StrategyExecutionTrace (status, timing)
- KeyNotFound trace for missing keys

Chain:
- InvokeTracedAsync with per-step status display
- Exception observability: ThrowingHandler + IHandlerExceptionObserver
- Failed status captured in trace before re-throw

Factory:
- Async factory registry (IAsyncFactoryRegistry + CreateAsync)
- Pooled factory registry (IPooledFactoryRegistry with RentAsync/Return)
- PooledBuffer product implementing IResettable

State:
- Entry/exit actions on [Transition] (OnEnter/OnExit attributes)
- IStateMachine instance wrapper with CurrentState tracking
- TryTransitionAsync firing entry/exit actions
- TryTransitionTracedAsync with TransitionTrace observability

EventAggregator:
- Error isolation via ContinueOnError on PublishTracedAsync
- FailingHandler demonstrating exception capture
- EventPublicationTrace with HasFailures and per-step status

README updated to reflect new sample capabilities.

Full solution builds clean (dotnet build DesignPatterns.Samples.slnx -c Release).
@Skymly
Skymly merged commit c006b4c into main Jun 28, 2026
1 check passed
@Skymly
Skymly deleted the feature/samples-sync-020-preview2 branch June 28, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant