Re:Secure by Design
by maxdeviant on Tuesday March 24, 2020 @05:15PM
(#22679082)
Yes. This is exactly what we do at work.
It makes sure that you never pass a `LocationId` where a `UserId` is expected; the type system literally will not allow it.
I just recently was working on a backend application and was modeling the database entities. The project uses UUIDs as primary keys. Should each entity have its own primary key type? `Location` gets a `LocationId`, User gets a 'UserId', etc, etc, where they're really all just wrappers around UUID?
Honestly, I thought about doing that a bunch of times during the start of the project, but I was pretty sure I'd get some harsh, sideways, glances from the rest of the team.