Both of these animals are slaughtered young so they aren't locked up for years and years.
Putting an dolphin in a small pond and put to work all day doing tricks is horrible. Whales and dolphins belong in the open ocean where they can swim for miles and miles. They are not domesticated animals.
My view is that if you have to put the animal in a cage to keep it, you shouldn't have them. The exception would be a fish tank with nothing exotic.