Yea, I was utilising CQRS as part of the asp.net boilerplate framework, which is quite a sophisticated enterprise framework, for about 8 months. So it completely threw me to suggest that you could somehow remove the need for repository and replace it with CQRS. Both seemed to me to be part of the picture.
I made an assumption that he must have been talking about it with regards to testing, but if he wasn't referring to testing then perhaps they aren't doing proper testing. So I've come to the conclusion that he didn't know what he was talking about. Which is probably at least part of the reason I didn't get that job. I did enjoy using the asp.net boilerplate framework. It still is the most complete start I know for an enterprise app. T. On 18 Jul 2016 9:08 AM, "Paul Glavich" <[email protected]> wrote: > It would seem to be the case, CQRS and repository are not mutually > exclusive patterns, far from it actually. They are quite often used > together. I would say CQRS is far broader pattern than the repository > which is simply to abstract the data store mechanism whereas CQRS is a > functionally more complex pattern. I would be curious how they are storing > commands and interacting with the query engine though. > > > > - Glav > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Nathan Schultz > *Sent:* Thursday, 14 July 2016 5:13 PM > *To:* ozDotNet <[email protected]> > *Subject:* Re: Command and Query Responsibility Segregation Pattern (CQRS) > > > > Hi Tony, > > > > Yeah, it seems strange to me too. > > > > Often CQRS is sometimes used in conjunction with Event Sourcing (i.e. an > append only data-store). So maybe he's thinking of the Repository Pattern > as a traditional CRUD interface, and it's that which they're not using? > > > > Regards, > > > > Nathan. > > > > On 14 July 2016 at 14:03, Tom Rutter <[email protected]> wrote: > > Hey Tony, I too am confused by the developer's comment. My understanding > is the same as yours it seems. > > > > > > On Wed, Jul 13, 2016 at 8:12 PM, Tony Wright <[email protected]> wrote: > > Hi all, > > > > I had a discussion the other day with an experienced developer who told me > that "instead of using the repository pattern, they just use CQRS these > days." > > > > I am somewhat puzzled with that statement, because it is my understanding > that the two are almost completely independent of each other. > > > > In simple terms, CQRS is used to separate requests from responses, so data > received from a database use different classes from the ones used to submit > updates. e.g. PersonCreateInputDto, which might contain just the fields > used to create a new person in the database, and PersonOutputDto, which > might contain just the fields needed to display a list of Person records. > You don't use the same object for both types of transaction, just the bare > minimum in each. > > > > Repository, on the other hand, is used for dependency injection. By > changing the dependency provider, I can switch a set of runtime classes > with a set of testing classes. The dependency provider injects the > dependent objects that are desired at the time, which could be either > runtime objects, or mock testing objects, so it is predominantly used to > enable better testing. > > > > I got the impression that the person was somehow using CQSR to perform > their testing instead. Is there something that I'm missing here? > > > > Regards, > > Tony > > > > >
