How to make a mesh follow certain rules? I am unable to understand a scenario where a whole turret is moving with an empty object. And it also follows physics rules.. Like if empty is moved along side z axis, mesh will move till a certain point.
Then after mesh won't move, won't deform, or won't loose it's shape. Also when turrets head is rotated it will rotate some parts of it automatically. It moves according to it's joints and moves other parts automatically as well. Even moving a single bone far from mesh won't strech the mesh.
A gif file will be able to clear the scenario in more detail and there is blender file link too. So help me understand how this is acheived and what's the name of this process.

Blender file
After the help of @amonroejj i found the solution. To achive this kind of scenario we have to set up FK and IK while connecting bones. And I was not aware that connecting two bones allows mesh not to deform and strech...