What 'best practices' exist for handing enum heirarchies?
- by FerretallicA
I'm curious as to any solutions out there for addressing enum heirarchies.
I'm working through some docs on Entity Framework 4 and trying to apply it to a simple inventory tracking program. The possible types for inventory to fall into are as follows:
INVENTORY ITEM TYPES:
Hardware
PC
Desktop
Server
Laptop
Accessory
Input (keyboards, scanners etc)
Output (monitors, printers etc)
Storage (USB sticks, tape drives etc)
Communication (network cards, routers etc)
Software
What recommendations are there for handling enums in a situation like this? Are enums even the solution? I don't really want to have a ridiculously normalised database for such a relatively simple experiment (eg tables for InventoryType, InventorySubtype, InventoryTypeToSubtype etc). I don't really want to over-complicate my data model with each subtype being inherited even though no additional properties or methods are included (except PC types which would ideally have associated accessories and software but that's probably out of scope here).
It feels like there should be a really simple, elegant solution to this but I can't put my finger on it. Any assistance or input appreciated!