Switching by use of transistor or relay
Transistor Vs relay, is like Horse Vs elephant, or Knight Vs bishop.
In other words, you'll see both being used for some time .The Relay, is more idiot proof, offers galvanic isolation and makes getting product approvals less problematic, and generally its voltage drop at high currents is lower, meaning less heat. But the relay is slow and has a limited number of operations and uses more space. The use of relay or transistor depends on the application requirements.