Posts

Showing posts with the label Java 8

Refactoring Factory Design Pattern with Lambdas

Image
Many existing object-oriented design patterns can be made redundant or written in a more concise way using lambda expressions. In this post, I would like to explain how to refactor Factory Design Pattern using  lambda expressions ?. This post may help in some situations like if we have implemented Factory Pattern in our projects using JDK 6 or 7. Now we want to use JDK 8 then we can refactor implementation of  Factory  Design  Pattern  using  lambda expressions  or we newly implement  Factory  Design  Pattern  using  lambda expressions  in our projects. Let's understand this refactoring technique with detail example. If you are new to Factory Pattern then there is a separate post for you:  Factory  Design  Pattern . If you want to revise or read the lambda expressions then visit  lambda expressions . As we know the  Factory  Design  Pattern  lets us create objects without expo...

Refactoring Chain of Responsibility Pattern with Lambdas

Image
Many existing object-oriented design patterns can be made redundant or written in a more concise way using lambda expressions. In this post, I would like to explain how to refactor  Chain of Responsibility Pattern  using  lambda expressions ?. This post may help in some situations like if we have implemented Observer Design Pattern in our projects using JDK 6 or 7. Now we want to use JDK 8 then we can refactor implementation of  Chain of Responsibility Pattern  using  lambda expressions  or we newly implement  Chain of Responsibility Pattern  using  lambda expressions  in our projects. Let's understand this refactoring technique with detail example. You can refer there is a separate post for  Chain of Responsibility Pattern . If you want to revise or read the lambda expressions then visit  lambda expressions . The chain of responsibility pattern is a common solution to create a chain of processing objects (such as a c...

Refactoring Observer Design Pattern with Lambdas

Image
Many existing object-oriented design patterns can be made redundant or written in a more concise way using lambda expressions. In this post, I would like to explain how to refactor Observer Design Pattern using lambda expressions ?. This post may help in some situations like if we have implemented Observer Design Pattern in our projects using JDK 6 or 7. Now we want to use JDK 8 then we can refactor implementation of  Observer Design Pattern  using  lambda expressions  or we newly implement  Observer Design Pattern  using  lambda expressions  in our projects. Let's understand this refactoring technique with detail example. You can refer there is a separate post for  Observer Design Pattern . If you want to revise or read the lambda expressions then visit:  lambda expressions The observer design pattern is a common solution when an object (called the subject) needs to automatically notify a list of other objects (called observers) w...

Refactoring Strategy Design Pattern with Lambdas

Image
In this post, I would like to explain how to refactor Strategy Design Pattern using lambda expressions ?. This post may help in some situations like if we have implemented  Strategy Design Pattern  in our projects using JDK 6 or 7. Now we want to use JDK 8 then we can refactor implementation of  Strategy Design Pattern  using  lambda expressions  or we newly implement  Strategy Design Pattern  using  lambda expressions  in our projects. Let's understand this refactoring technique with detail example. If you want to revise or read the Strategy Design Pattern then visit:  Strategy Design Pattern . If you want to revise or read the lambda expressions then visit:  lambda expressions Strategy Design Pattern can be written in a more concise way of using lambda expressions. The  Strategy Design Pattern  states that it is a common solution for representing a family of algorithms and letting you choose among them at runt...