Labels

algorithms (22) Design Patterns (20) java (19) linux (14) Snippet (13) service mix (6) soa (4)

Template Method


"Defines the skeleton of the algorithm , and defers some implementation to the sub classes."

the above example makeDrink() calls

  1. addWater
  2. addFruit
  3. addIce
the addFruit implementation is left to the sub classes orange and apple juice makers

the method makeDrink is made final so that the steps of making the juice is not changed

4 comments:

  1. Please may you explain this example
    Thank you ...

    ReplyDelete
  2. I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts. hyip template

    ReplyDelete
  3. Thanks for the informative and helpful post, obviously in your blog everything is good.. goldcoders hyip templates

    ReplyDelete

Search 24 Bytes