![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I think I got it where all this bs about passing around numerical ids of entities instead of entity references (maybe lazy) come from. It's like 'error code'. It comes from the ancient c programming, where we just could not allocate a string for a readable piece of text, or for the data that may need some efforts to instantiate or allocate.
In short. It's stupid to pass around "ids" in a program.
In short. It's stupid to pass around "ids" in a program.
no subject
Date: 2015-10-01 10:09 pm (UTC)eg two strings "abc" and "abc" are equal but using a mere reference is wrong in most cases. (ie using a reference only makes sense in some memory management sort of context)
no subject
Date: 2015-10-02 12:27 am (UTC)no subject
Date: 2015-10-02 06:49 am (UTC)I reckon it is not the case of being lazy and saving the id instead of a reference. It may be the case that the id can be constructed, but the whole object needs to be found. You could even view it as a constructor (global static map or factory): given A, return B. A is id, B is the object. You say keep a reference to B. I say, is it really that different from constructing it using A, especially if A is isomorphic to B.
Eg error code is the same, error message is location-specific. Besides, the error message is constructed from a template, so you can't really look up translations using, say, a canonical string (in English).