Archive for ‘Design Patterns’

How Strategy Pattern help in reducing code duplication, avoid type casting and make design Better

How Strategy Pattern help in reducing code duplication, avoid type casting and make design Better

Yesterday I was trying to refactor some code which has lots of code duplication, static type casting between sub types and cohesive. After some refactoring I decided to use java’s strategy design pattern to remove code duplication and make it extendable. The motive behind using strategy pattern was to move behavior out of the...

Full Post

How to make custom collections iterable?

How to make custom collections iterable?

The benefits of using an iterator is to allow the the client to iterate over the collection of objects, without exposing implementation details. This gives you the benefit to change what collection the Iterator iterates over and how each element is served, without making any change the client’s code. To iterate a custom collection,...

Full Post

Copyright © 2017 TechZoo - Technology Blog. All rights reserved.
Proudly powered by WordPress. Developed by 7Tech Solutions