The way my game is structured, (it's huge) with tons of areas, regions and environments with a limited character pool (10 characters, 4 in the main party, 6 reserve characters) 10 main classes and 120 sub classes which can be switched at will either through the menu or with 1 character's main class who gets a spell that can switch an actor's class in battle.
The main-main character is a Paladin and it's story related, but his sub-classes are things like Holy Knight, Cavalier, Hausser, Defender, etc etc etc. Each has different stat focuses and growths, for example, the Paladin is a defense heavy but relatively balanced class, lower damage than a monk or warrior but I'd say C+ damage over all, Defense is the highest stat and he gets access to Cover from level 1 (and I've made cover a targeted spell, and Cover II is a random activation 35% of the time for 5 turns to cover an ally being attacked, which is unlocked at level 25)
Enough of that nonsense though. MDF is what we're talking about. The Paladin class in my game has... maybe C+/B- Magic Defense, BUT the sub-class Holy Knight has A+ MDF and C+ish DEF
There is equipment which makes most of the subclass choices optional, if a player REALLY likes playing the Paladin class and using the spells and skills available to that class, there is more than enough gear which can be obtained prior to the really REALLY magic heavy fights that would mitigate enough magic damage that taking the Holy Knight path isn't necessary.
It's all about giving the player a choice and having benefits and consequences for each choice. For example
Spoiler
The main character has a very special class which can be permanently locked in the last chapter of the game, just before the final dungeon, it's story related, I won't spoil too much but it's super frackin' cool.
Same with the 2ndary main character, she gets a really cool transformation as well but only if the player meets certain requirements, does certain quests, makes certain choices, etc etc.
Failing that, the main character and the 2nd main character stay the same for the final chapter/fight
Failing that, if the player makes "evil" choices then the main characters around the mid point of the game will transform into a Dark Knight and Dark Cleric, which is permanent (unless the player goes way out of their way to do a series of side quests to "redeem" the characters)
MDF is a necessity in a "High-Fantasy" type world, I've always loved high fantasy and "Sword and Sorcery" type settings/games/books/etc.
Doing MDF in a unique way is great, I prefer to have story driven elements which explain MDF. The Holy Knight option is unlocked via a series of quests at some temple where the Paladin can learn to channel the holy powers of "The Goddess" into elemental "shields" and "armor" which grant immunity to certain magical attacks and over the course of "training", learns how to over power magical forces.
In my game, the greater story explains all the forces of the world, magic isn't some "thing" that just exists for no reason. It's something that has to be learned, and mages learn to manipulate the physical elements, so... in essence, the Holy Knight learns how to counter-manipulate the mage who is manipulating the elements BUT because Magic is a "Sin" against "The Goddess" the Holy Knight can never use his training to manipulate the elements himself to learn those sorts of spells, he can only "break" the arcane forces around the magic to lessen it's power or at higher levels nullify it or even "seal" an enemy's magic. That's how I've chosen to deal with MDF