[2403.06707] Deriving Dependently-Typed OOP from First Principles -- Extended Version with Additional Appendices