Skip to content

docs: say that a Factory or Instance member lifts AWT103's concrete-type requirement - #139

Merged
vbreuss merged 2 commits into
mainfrom
docs/factory-lifts-concrete-requirement
Aug 2, 2026
Merged

docs: say that a Factory or Instance member lifts AWT103's concrete-type requirement#139
vbreuss merged 2 commits into
mainfrom
docs/factory-lifts-concrete-requirement

Conversation

@vbreuss

@vbreuss vbreuss commented Aug 2, 2026

Copy link
Copy Markdown
Member

The capability has always existed and is what the runtime factory tests exercise: with a Factory (or, on a singleton, Instance) member the container constructs nothing, so the registration type argument may be an interface or abstract type, naming only the service. Nothing user-facing said so: the attribute docs called the type argument "the concrete type to construct", and AWT103 answered "Register a concrete type" with no second exit. A real migration (testing-plan rung 3, Camelot) read both and built an unnecessary delegating wrapper around a library factory returning an internal type.

  • The single-type-argument [Singleton<T>] / [Scoped<T>] / [Transient<T>] XML docs now name the member exit and qualify the concrete-type requirement.
  • AWT103's message and its diagnostics-page entry offer the Factory/Instance exit, with a factory-shaped sample.
  • Generator tests pin the new message clause and, for the first time, pin that AWT103 stays silent for an interface produced by a Factory and by an Instance member.
  • A runtime test pins the interface-typed Instance member shape the factory tests did not cover.

No behavior changes; the public API baseline is untouched.

vbreuss added 2 commits August 2, 2026 14:07
…e requirement

The capability has always existed and is what the runtime factory tests exercise: with a Factory (or, on a singleton, Instance) member the container constructs nothing, so the registration type argument may be an interface or abstract type, naming only the service. Nothing user-facing said so: the attribute docs called the type argument the concrete type to construct, and AWT103 answered register a concrete type with no second exit. A real migration (testing-plan rung 3) read both and built an unnecessary delegating wrapper around a library factory returning an internal type.

The attribute XML docs and the AWT103 message and doc entry now name the member exit, generator tests pin that AWT103 stays silent for an interface produced by a Factory or an Instance member, and a runtime test pins the interface-typed Instance member shape the factory tests did not cover.
@vbreuss
vbreuss force-pushed the docs/factory-lifts-concrete-requirement branch from 508a6c6 to cb77f90 Compare August 2, 2026 12:15
@vbreuss
vbreuss enabled auto-merge (squash) August 2, 2026 12:16
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Test Results

   18 files  ± 0     18 suites  ±0   10m 1s ⏱️ -8s
1 324 tests + 4  1 323 ✅ + 4  1 💤 ±0  0 ❌ ±0 
6 453 runs  +16  6 452 ✅ +16  1 💤 ±0  0 ❌ ±0 

Results for commit cb77f90. ± Comparison against base commit 9103996.

@vbreuss
vbreuss merged commit 16c1df3 into main Aug 2, 2026
15 checks passed
@vbreuss
vbreuss deleted the docs/factory-lifts-concrete-requirement branch August 2, 2026 12:23
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon 6973P-C 4.09GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Resolve Size Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 8 7.471 ns 0.0088 ns 0.0078 ns 1.40 - NA
Awaiten 8 5.329 ns 0.2922 ns 0.2281 ns 1.00 - NA
MsDI 8 5.030 ns 0.0418 ns 0.0326 ns 0.95 - NA
Autofac 8 88.866 ns 4.3256 ns 4.0462 ns 16.70 656 B NA
Jab 8 2.416 ns 0.0303 ns 0.0284 ns 0.45 - NA
PureDI 8 4.343 ns 0.1255 ns 0.0980 ns 0.82 - NA
DryIoc 8 6.475 ns 0.0265 ns 0.0221 ns 1.22 - NA
SimpleInjector 8 8.367 ns 0.0150 ns 0.0140 ns 1.57 - NA
baseline* 256 8.692 ns 0.0092 ns 0.0077 ns 1.39 - NA
Awaiten 256 6.241 ns 0.0086 ns 0.0071 ns 1.00 - NA
MsDI 256 5.032 ns 0.0862 ns 0.0673 ns 0.81 - NA
Autofac 256 86.526 ns 5.1483 ns 4.0195 ns 13.86 656 B NA
Jab 256 36.709 ns 1.0159 ns 0.7932 ns 5.88 - NA
PureDI 256 5.810 ns 0.6353 ns 0.5942 ns 0.93 - NA
DryIoc 256 6.792 ns 0.0105 ns 0.0098 ns 1.09 - NA
SimpleInjector 256 8.833 ns 0.7129 ns 0.6668 ns 1.42 - NA
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Realistic Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 250.9 ns 2.99 ns 2.80 ns 1.08 568 B 1.00
Awaiten 233.1 ns 1.54 ns 1.29 ns 1.00 568 B 1.00
MsDI 594.1 ns 1.88 ns 1.66 ns 2.55 1104 B 1.94
Autofac 6,585.6 ns 16.67 ns 15.59 ns 28.26 10784 B 18.99
Jab 173.9 ns 1.15 ns 1.02 ns 0.75 432 B 0.76
DryIoc 385.7 ns 1.87 ns 1.75 ns 1.66 944 B 1.66
SimpleInjector 742.0 ns 5.21 ns 4.62 ns 3.18 1096 B 1.93
PureDI 174.5 ns 1.50 ns 1.33 ns 0.75 632 B 1.11
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.302
[Host] : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Build Size Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 8 16.818 ns 0.2205 ns 0.2063 ns 1.00 144 B 1.00
Awaiten 8 16.78 ns 0.111 ns 0.099 ns 1.00 144 B 1.00
MsDI 8 1,484.29 ns 23.758 ns 21.061 ns 88.44 5688 B 39.50
Autofac 8 30,312.79 ns 242.375 ns 226.718 ns 1,806.06 33098 B 229.85
Jab 8 11.74 ns 0.424 ns 0.396 ns 0.70 96 B 0.67
PureDI 8 16.00 ns 0.538 ns 0.503 ns 0.95 128 B 0.89
DryIoc 8 695.27 ns 11.508 ns 10.764 ns 41.43 1528 B 10.61
SimpleInjector 8 12,832.85 ns 224.724 ns 210.207 ns 764.59 24760 B 171.94
baseline* 256 92.622 ns 0.4053 ns 0.3593 ns 0.95 2128 B 1.00
Awaiten 256 97.49 ns 2.774 ns 2.595 ns 1.00 2128 B 1.00
MsDI 256 14,524.11 ns 116.607 ns 109.074 ns 149.08 61016 B 28.67
Autofac 256 752,330.76 ns 6,907.426 ns 6,461.211 ns 7,721.97 738949 B 347.25
Jab 256 83.46 ns 0.707 ns 0.662 ns 0.86 2080 B 0.98
PureDI 256 91.31 ns 1.137 ns 1.008 ns 0.94 2112 B 0.99
DryIoc 256 43,369.90 ns 647.803 ns 605.956 ns 445.15 80641 B 37.90
SimpleInjector 256 394,349.44 ns 5,075.937 ns 4,499.686 ns 4,047.63 573139 B 269.33

baseline* rows show the corresponding Awaiten benchmark from the most recent successful main branch build with results, for regression comparison.

github-actions Bot added a commit that referenced this pull request Aug 2, 2026
…mber lifts AWT103's concrete-type requirement (#139) by Valentin Breuß
github-actions Bot added a commit that referenced this pull request Aug 2, 2026
…mber lifts AWT103's concrete-type requirement (#139) by Valentin Breuß
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