@@ -278,4 +278,54 @@ functionality, you should implement your own custom ServiceAttribute.]]></conten
278278 </deprecation >
279279 </meta >
280280 </architecturalDecision >
281+ <architecturalDecision id =" DeprecateDefinitionBuilderImplementations" attribute =" Cspray\AnnotatedContainer\ArchitecturalDecisionRecords\DeprecateDefinitionBuilderImplementations" >
282+ <date >2025-05-15</date >
283+ <status >Accepted</status >
284+ <contents ><![CDATA[ # Deprecate Definition Builder implementations
285+
286+ ## Context
287+
288+ Starting with the initial versions of Annotated Container most Definitions that make up a ContainerDefinition are
289+ created through a series of "builder" objects using a fluent API. Ultimately, even the functional API utilizes the
290+ builder API when you aren't using attributes to declare your ContainerDefinition. The intent of these builder objects
291+ is to provide a singular, correct method for creating implementations for the interfaces that make up a
292+ ContainerDefinition. In practice, these objects proved to be more difficult to use than expected, and led to an
293+ increase in maintenance requirements.
294+
295+ ## Decision
296+
297+ The fluent API for creating definitions proved to be clunky to use, hard to test properly, and created lots of
298+ static analysis issues. In v3, these issues started to exacerbate when we needed to make changes to the underlying
299+ Definition interfaces and their corresponding builders. Instead of continuing with this subpar system, it was
300+ removed in v3 in favor of a concrete Factory class that ensures resultant Definitions are valid and proper without
301+ having to rely on a chain of fluent API calls.]]> </contents >
302+ <codeAnnotations >
303+ <codeAnnotation >
304+ <class >Cspray\AnnotatedContainer\Definition\AliasDefinitionBuilder</class >
305+ </codeAnnotation >
306+ <codeAnnotation >
307+ <class >Cspray\AnnotatedContainer\Definition\ServiceDefinitionBuilder</class >
308+ </codeAnnotation >
309+ <codeAnnotation >
310+ <class >Cspray\AnnotatedContainer\Definition\ServicePrepareDefinitionBuilder</class >
311+ </codeAnnotation >
312+ <codeAnnotation >
313+ <class >Cspray\AnnotatedContainer\Definition\InjectDefinitionBuilder</class >
314+ </codeAnnotation >
315+ <codeAnnotation >
316+ <class >Cspray\AnnotatedContainer\Definition\ServiceDelegateDefinitionBuilder</class >
317+ </codeAnnotation >
318+ </codeAnnotations >
319+ <meta >
320+ <author >
321+ <name >Charles Sprayberry</name >
322+ <website >https://cspray.io</website >
323+ <githubProfile >https://github.com/cspray</githubProfile >
324+ </author >
325+ <deprecation >
326+ <since >2.4.0</since >
327+ <scheduledForRemoval >3.0.0</scheduledForRemoval >
328+ </deprecation >
329+ </meta >
330+ </architecturalDecision >
281331</architecturalDecisions >
0 commit comments