Let's chat about naming

a brief treatment of naming things

Ben Collins

2 minute read

Hello there, developer. Come, sit down with me. We need to have a talk. A famous saying in our industry goes something like this: There are two hard problems in computer science: cache invalidation, naming things, and off-by-one errors (rimshot) There are a few guidelines we should be keeping in mind as we name things: Grammatical correctness. The humor is in the off-by-one irony of course, and we accept uncritically that naming things is hard.

Ben Collins

8 minute read

Motivation In my previous post, Practical Permission-based Authorization in ASP.NET Core, I tried to demonstrate how to implement a regime of permissions-based authorization without having to stuff it all into an ever-exploding list of roles, without abusing claims, and without having to roll your own framework-fighting implementation. Resource filters allow you to do this elegantly and still remain in harmony with the framework. However, I may have been too terse. I got a couple questions and a request for a working example, which seemed like a reasonable request, so that what this post is about.

Ben Collins

3 minute read

ASP.NET Core applications are configured using the Configure and optionally, the ConfigureServices methods of the startup class (typically Startup). ConfigureServices is used to set up the dependency injection container that ships with ASP.NET Core. The method signature looks like this: public void ConfigureServices(IServiceCollection services); That IServiceCollection instance is the developer’s surface area for configuring dependencies. Mvc can be configured like this: public class Startup { // … public void ConfigureServices(IServiceCollection services) { // …