The programmer's equivalent of a rosary
Jan. 8th, 2009 03:56 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Say to yourself ten times each day, "Raw Integers and Stringified Integers do *not* make acceptable IDs for your model objects. You should be using strongly-typed ID objects whenever possible."
Yeah, I know -- I really should know better, but it was so *easy* to just use the ints from the initial database representation (and derive type from context) that they wound up laced through the system. But while they haven't caused any Horrible Disasters yet, it's probably only a matter of time, and they will probably fail scalability eventually. So I'm currently doing penance by going through the whole system and replacing them with properly-typed ID wrappers everywhere that I can find them, which should make the next steps a *lot* more solid...
Yeah, I know -- I really should know better, but it was so *easy* to just use the ints from the initial database representation (and derive type from context) that they wound up laced through the system. But while they haven't caused any Horrible Disasters yet, it's probably only a matter of time, and they will probably fail scalability eventually. So I'm currently doing penance by going through the whole system and replacing them with properly-typed ID wrappers everywhere that I can find them, which should make the next steps a *lot* more solid...