Repository pattern for use in Reports only?
I am creating an MVC application where I'm going to be creating quite a few RDLC based reports. Looking at some of the examples out there on the web, it seems like the best way to use the report data source is through a repository.
My application will have to work with several databases. I already use the pattern to read/write to the database through POCO objects.
1) Rather than extend my current repository classes which are in my domain project, I was going to add separate repository classes to my Web project that deals only with the reports requirements.
2) Would it make sense to use the Repository pattern to only return different IQueryable/IEnumerable result sets that I could then use within my reports? Or would this be the wrong use of the REpository p开发者_如何学JAVAattern?
I'd really like to hear your views on how you would go about with the above.
Thanks
It's better to use queries for reports because you need nothing but "read" operations there. Take a look at CQS(CQRS) pattern.
精彩评论