trait protocol delegate mixin inherit derive compose encapsulate polymorphism singleton