R – ASP.NET MVC with Pipes & Filters Pattern. Benefits


I'm just about to start a new project on ASP.NET MVC using LINQ to SQL for ORM. So, I have read and watched various tutorials about best practices and I wonder:

What is the benefit on using the pattern Pipes&Filters in my model (have in mind, I intend to use LINQ to SQL). Why just not use repository pattern in the model for retrieving objects from DB with LINQ to SQL and add some LINQ expression in my controllers to filter the data.

What I can think of is:

  • more testability for filter logic (but this is useful for some complicated with logic filters)
  • data processing logic is better encapsulated in the model,

but is there any stronger benefits in that ?

Best Solution

you are gonna be tied to your ORM in someway, using query operators outside the mode -using pipes and filters-.

your accesing logic will be segregated through your app, complexing refactors and testability.

the controllers are beautier when they are fit ;)