Composition over inheritance is a staple in object oriented programming since the early 1990s. Developing with Solidity on the EVM has forced me to re-examine several programming paradigms. With Ethereum, there are other considerations given that smart contracts are typically immutable and gas costs become a more important factor. I wanted to take some time talking about this design pattern and sharing some examples with the community.
Composition over inheritance is a staple in object oriented programming since the early 1990s. Developing with Solidity on the EVM has forced me to re-examine several programming paradigms. With Ethereum, there are other considerations given that smart contracts are typically immutable and gas costs become a more important factor. I wanted to take some time talking about this design pattern and sharing some examples with the community.