Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

PipelineExamples - Pipeline Design Pattern in C#

YouTube Blog Newsletter All Links LinkedIn

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.

Getting Started

Prerequisites

  • .NET 8.0 SDK or later
  • An IDE such as Visual Studio, Visual Studio Code, or JetBrains Rider

Running the Project

# Run the Autofac DI-based pipeline
dotnet run --project AutofacPipelineConfiguration

# Run the functional delegate-based pipeline
dotnet run --project PipelineExamples

Related Resources

Blog Articles

Newsletter

If 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

Connect with Dev Leader


BrandGhost

Powered by BrandGhost 👻