Object composition library with traits and interfaces