views:

178

answers:

1

Hi everyone, 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 ?

+1  A: 

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 ;)

SDReyes
I'm happy to see, that I've been on the right track.P.S: I'm not a sql-hater, but I really don't like this sql-like expressions in my code :)
anthares
hahaha me too. I like sql in fact.but we aren't plumbers do we? haahhaha
SDReyes