
The approach I settled on was articulated recently by the host of a podcast that I enjoy called The Shooting Bench with Cope Reynolds. Cope is an experienced competition shooter, Army veteran, gun shop owner, and he's also certified by New Mexico and Utah to teach concealed carry courses for those states. His basic approach seems appropriate and it's easy to recall/utilize.
Essentially, to be justified in the use of deadly force, you must "reasonably believe" at the time of the shooting that the assailant had 1. the intent, 2. the ability and 3. the opportunity to cause you greivous bodily harm and/or death. If these three elements are satisfied, you'll likely be justified in the use of deadly force and avoid potential criminal liability for the shooting (potential civil liability is a separate issue that's much more difficult to determine in the abstract).
For the purposes of this three element formula, "intent to harm" equates to some sort of overt threat to your safety/well-being (i.e., "gimme your wallet or I'll blow your head off"). Likewise, "ability to harm" refers to the object(s) wielded by the "bad guy" at the time of the encounter (e.g., a firearm, knife, baseball bat, machete, bazooka, etc.). Finally, "opportunity to harm" refers roughly to considerations of proximity and distance. For example, a dude wielding a knife is a bona fide threat if he's standing next to/right behind you, however if the same guy with the knife is 100 feet away from you he won't be an immediate threat to your safety. The closer the bad guy is to you, the better, for the purposes of legal defense and post-shooting justification.
Conversely, if any of these three basic elements are missing from the scenario (i.e., you "reasonably" ascertain that the "bad guy" had the intent to cause you greivous harm but lacked the opportunity or the ability to do so, etc.), the shooting will likely not be justified and you'll risk criminal charges. Here's where shooting an assailant "through a closed door" or while he's "fleeing from the scene of a robbery" becomes problematic and very complex.
Of course, studies have shown that an assailant armed with a knife can realistically traverse a distance of 21 feet and inflict a fatal stab wound in less than two seconds...imagine that!

What are your thoughts on the subject...