Monday, May 27, 2019

Nineteen days ago I saw Jason Taylor speak on clean architecture at the Norwegian Developers Conference.

NorthwindTraders is an example of what Jason Taylor dubbed "clean architecture" which seemed a lot like onion architecture to me, only significantly updated. Gone is the reliance on NHibernate. The modern orchestration uses Entity Framework Core 2.2 inside of ASP.NET Core 2.2 in an attempt to follow a KISS (keep it simple, stupid) cut and dry approach. CQRS is in the mix. The central, no-dependencies-leaking-in, Core project of the onion architecture is redubbed the Common project in the NorthwindTraders application. It was suggested to use data annotations sparingly for simple scenarios or perhaps, not at all. The FluentValidation NuGet package was instead recommended for, yes, fluent validations. The validations and the common extension methods were pulled out of the Common project into the infrastructure project which surprised me a little bit. Jeffrey Palermo used to suggest that the Core (i.e. Common) should be as fat as possible with testable code detached from the UI and external dependencies. Jason Taylor's Common project is kept light in contrast. The Swagger specification has become the OpenAPI specification and this was in there as well. Swagger, er OpenAPI, is really gold for discoverability in a microservices architecture. Another thing in the mix is MediatR. Its author, Jimmy Bogard, was at this event and I spoke with him some. His talk, which I didn't catch, had to do with transactions in MongoDB. Apparently, if you send ten documents from point A to point B and the process barfs partway through there is no way to roll back the three of ten documents that got written at point B. The solution is to have something listening at both endpoints and double-checking expectations with the opposite endpoint. Again, I didn't see the talk and I am sort of jamming this in here as an afterthought as it is worth mentioning. I'll offer a second, similar afterthought. As an attendee of Norwegian Developers Conference you could vote green, yellow, or red on a talk by putting a card in a bin when you walked out from the talk. Green meant good and yellow meant ho-hum. I never myself saw anyone put red cards in, but as I was talking to a coworker of mine between talks he became distracted by all of the red cards being cast behind me as people emptied out of the "patterns for high-performance C#" talk of Federico Andres Lois. We theorized that the talk was a bait-and-switch sales pitch for RavenDB.

No comments:

Post a Comment