Code Refactoring 16

Replace Embellishment to DecoratorIn this tutorial, I’ll answer a question that was sent to me. The question pertains to how can we add additional features to code the right way.

When new features are needed it is a bad idea to add new code to older classes. This makes compact easy to understand classes complicated because they break the Single responsibility principle. I’ll show you here how the decorator design pattern instead places each special case behavior (Embellishment) into its own class.

This is a fabulous pattern. The code below will help you learn from the video.

If you like videos like this, it helps to tell Google+ [googleplusone]

Code From the Video

2 thoughts on “Code Refactoring 16”

  1. Hi Derek,

    Could you please add videos to explain on

    1) How to consume Web Services
    2) Integration with REStful APIs
    3) Integration with gateways (eg:- paypal)
    in Android Applications.

    Thanks,
    Siva

Leave a Reply

Your email address will not be published. Required fields are marked *