Content deleted Content added
Line 70:
According to the '''polymorphism''' principle, responsibility for defining the variation of behaviors based on type is assigned to the type for which this variation happens. This is achieved using [[Polymorphism (computer science)|polymorphic]] operations. The user of the type should use polymorphic operations instead of explicit branching based on type.
Problem: How to handle alternatives based on type? How to create pluggable software components?<br>
Solution: When related alternatives or behaviors vary by type (class), assign responsibility for the behavior—using polymorphic operations—to the types for which the behavior varies.(Polymorphism has several related meanings. In this context, it means "giving the same name to services in different objects")
|