This solution demonstrates two different implementations of the Pipeline design pattern in C#, both solving the same text analysis problem — reading user input, cleaning text, counting word frequencies, and summarizing the top results. The two approaches highlight the trade-offs between structured OOP pipelines and lightweight functional pipelines.
The AutofacPipelineConfiguration project implements a full object-oriented pipeline using Autofac dependency injection. It defines pipeline stages as separate classes (PipelineSource, TextCleaner, WordCounter, TextSummarizer, PipelineSink) with interfaces like IPipelineStage, IPipelineSource<T>, and IPipelineSink<T>. Stages are registered as singletons in an Autofac container, and a MostlyAutoPipelineBuilder with IPrioritizedPipelineIntermediate supports priority-ordered stage execution. The PipelineExamples project takes a simpler functional approach using delegates and Task.Run().ContinueWith() chains for pipeline flow.
Together, these projects provide a comprehensive comparison of pipeline pattern strategies — from enterprise-ready DI-based composition to lightweight async delegate chains — helping developers choose the right approach for their use case.
- .NET 8.0 SDK or later
- An IDE such as Visual Studio, Visual Studio Code, or JetBrains Rider
# Run the Autofac DI-based pipeline
dotnet run --project AutofacPipelineConfiguration
# Run the functional delegate-based pipeline
dotnet run --project PipelineExamplesIf you found this useful and you want to learn more about C#, .NET, and software engineering, subscribe to the free Dev Leader Weekly newsletter:
Subscribe to Dev Leader Weekly
- All Links
- Website - Dev Leader
- YouTube - Dev Leader
- YouTube - Dev Leader Path To Tech
- YouTube - Dev Leader Podcast
- YouTube - CodeCommute
- Newsletter - Dev Leader Weekly
- LinkedIn - Nick Cosentino
- GitHub - ncosentino
- Twitter/X - Dev Leader
- Threads - Dev Leader
- Bluesky - Dev Leader
- Mastodon - Dev Leader
- Facebook - Dev Leader
- TikTok - Dev Leader
- Twitch - Dev Leader
- Stack Overflow - Nick Cosentino
Powered by BrandGhost 👻