As David lie dying he charged his son Solomon to bring deathly vengeance to an old enemy-
There is also with you Shimei son of Gera, the Benjaminite from Bahurim, who cursed me with a terrible curse on the day when I went to Mahanaim; but when he came down to meet me at the Jordan, I swore to him by the Lord, ‘I will not put you to death with the sword.’ Therefore do not hold him guiltless, for you are a wise man; you will know what you ought to do to him, and you must bring his gray head down with blood to Sheol.”
‘I won’t kill you’, David promised Shimei…. but Solomon, you must. David’s last word wasn’t a prayer of confession or a word of praise- it was a vindictive vengeful charge to his son.
That’s what the Deuteronomist thought of David. Because right after David uttered these words, the Deuteronomist reports that he died.
The Deuteronomist despised David as much as David despised Shimei…