3 ms·
Recently I started to use enumeration classes instead of enums ( where it fits) https://docs.microsoft.com/en-us/dotnet/architecture/microservices/microservice
by NicoJuicy 6y ago
Recently I started to use enumeration classes instead of enums ( where it fits)
https://docs.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types https://docs.microsoft.com/en-us/dotnet/architecture/microse...
If you develop in c#, I would definitely recommend trying it out
A better example can be found here actually: https://lostechies.com/jimmybogard/2008/08/12/enumeration-classes/ https://lostechies.com/jimmybogard/2008/08/12/enumeration-cl...
- nerdponx 6y agoWhat's the basic idea here? That instead of ints or strings, your enum values themselves are instances of custom classes with whatever behavior you want?
- NicoJuicy 6y agoIf I would describe the use-case: If you use switches with enums for functionality, this is a better way ( personal opinion). Since Enums quickly need more than 1 switch and this could wrap that behaviour Your description is also pretty good