From OOP to Rust: Composition, Not Inheritance

  • Inheritance is key to OOP’s success as a paradigm. Decades of successful software engineering has been done with Inheritance as a core part of business logic.

  • So why did rust avoid inheritance?

  • How do we move from inheritance-based problem solving to rust’s approach?

  • How do you represent heterogeneous collections in rust?

This slide and its sub-slides should take about 106 minutes.
  • In this section we’ll be looking at how to move from thinking about polymorphic problem solving with types in OOP languages like java, C++ etc. to Rust’s trait-based approach to Polymorphism.

  • There will be differences, but there are also plenty of areas in common – especially with modern standards of OOP development. Remember to keep an open mind.