Using mix-ins to add behavior

We've seen how to use inheritance and composition to add behavior. There is a different method of composition that appends behavior onto existing classes without inheritance. Using mix-ins attaches properties to an object instance at runtime.

In this recipe, we'll see how to use the mix-ins to add shared behavior to classes without inheritance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.115.121