Write and explain the definition of what composition is and how it is useful in writing an object-oriented program. Also, explain how it is different from inheritance and how both inheritance and composition are useful in developing object-oriented programs.