Buildings have 3 database entries: the foundation item, the foundation when it's on the terrain, and the actual building on the terrain.
Turrets specifically have different "parent" entities which modify the parameters of the head/chassis/leg parts, which are the same for all turret types. (Turrets are robots basically.) This is also the reason why it's hard to put the optimal range info into the turret, as it is in the equipped weapon of the turret. It's like as if you would try to get your weapon info into your robot's info.
Sounds chaotic? It is. We'll try to do something about it.