My Rants and Raves about technology, programming, everything else...
Writing APIs have been a big part of my career. I've written COM, DCOM, XML based APIs, ISAPI Filters, SOAP, REST, gRPC, and others. A lot of this time a new technology in writing APIs has been chasing the new ‘cool’ technology that would fix everything.
The chase has always been lost cause. APIs, like most things in computer science, are a set of compromises. I think, for the first time in my career, we're entering a time when we don't need a ‘winner’ but need to stop thinking about APIs as a better hammer.
While Microsoft's announcement of embracing gRPC and GraphQL both came as surprises, I'm still flummoxed by some developer's insistence that some new technology is the one to rule them all. That's made me start thinking about how we can think of APIs in a different way.
If you're using .NET Core 3 and Entity Framework Core 3 together, you're probably using the EF Tools too. I've been running into an odd issue with it and wanted to share what is going on.
I know I don't look like it, but I actually like to follow the suggestions. So when I get the following suggestion form the command-line, I tried to update my version:
I'm working on an example to explore some more complex modeling in EF (for SQL and NoSQL) but that's not ready so I thought I'd use it as a bed for some Validation testing I'm doing. The result is some exploration of the FluentValidation project that I haven't had time to dig into until now.
Validation is an interesting exercise in ASP.NET (Core) and trying to get it correct is quite difficult. Ultimately in this day of SPAs and mobile apps, we need a solution that handles the client and the server. If you don't validate on the server it just doesn't matter.
FluentValidation is a replacment for the existing validation attributes (DataAnnotations) that you might already be using. The idea is to separate the validation from the classes. To be clear, this doesn't replace setting up your Entity Framework types with Fluent API this is about server-side validation only. Think of it as a clearer way to define rules for validation of your models or DTOs.
I may be very late to the party, but once Gulp 3.x stopped working with recent versions of Node, I've been forced to update my projects to the newest version of Gulp.
I was hesitant to learn it as I often think of Gulp as just a side-line tool that I use for production. Luckily for me, the new Gulp is actually simpler and more intuitive. I wanted to write a quick blog post explaining how I converted them.
Let's start with my Gulp 3 version:
I was delighted to spend some time today at Connect.Tech conference. Great web conference and it was packed. So many excited people who wanted to talk about web technologies!
I saw some great talks before mine. I tried to convince the audience that Vuex would simplify not complicate their Vue projects. Hopefully I succeeded.
As promised, I wanted to share my slide and code.
They finally posted the video, so if you want to see the talk, here is your chance:
As promised, here are links to the code and slides from the talk:
Unless you you haven't been paying attention to me or my blog the last three years, you know that I've been working on a film. The feature-length documentary is about my love for the software industry and the lack of diversity that I see in it.
I am trying to raise enough money to finish the film. It's been a three-year project where I've interviewed over fifty people across several continents. I've talked to developers, educators, and industry leaders about what there is to love about the job that most of us do. We've edited the film and had a couple of test screenings so we're close to being done.
In fact, I shot so much footage that many of the topics I wanted to covered got cut from the film. That has left me with the opportunity to make some short films that covered several of these topics. The first of these is now available:
Endpoint Routing was introduced in ASP.NET Core 2.2 but has been made a first class citizen of ASP.NET Core in 3.0. While you're old projects will continue to work without it, upgrading to Endpoint Routing will improve your applications.
Endpoint Routing is a system to handle routing across different middleware systems (e.g. MVC, Razor Pages, Blazor, SignalR and gRPC). By having endpoints that work with each other, you can think of a system more holistically then having terminal middleware that don't talk to each other. Let's see what that actually means in practice.
If you've seen the new project template, you've probably already noticed that setting up RazorPages and MVC look a bit different. First in the ConfigureServices:
I'm finally getting around to looking at updating my examples and courses to 3.0. This post is based on .NET Core Preview 8 so this might change in the future.
There are a number of great walkthroughs for moving your ASP.NET Core 2.x projects to 3.0. So I don't want to repeat that. Instead, I want to talk about what's happening, not just a list of things to do.
To discuss these changes, i'll talk about a project I'm current converting (CoreCodeCamp which is the basis for the Atlanta Code Camp), though it's a branch that likely won't be deployed until after the event.
If you've viewed my new "Designing RESTful Web APIs" course on Pluralsight, you've already encountered my small API that I use as an exammple. While the course is platform agnostic, i'll admit that I built it with ASP.NET Core (2.2).
For this new project, I decided that running in a container would be useful as it's pretty self-contained and should just return to it's initial state when the container is restarted. While I won't be releasing that source, I did learn a lot about debugging in a container that I thought I'd share.
I started this new project and opted into using Docker in the project: