Home » Tag Archives: Design Patterns (page 5)

Tag Archives: Design Patterns

Design Patterns: Strategy

java-logo

This time I want to talk about Strategy design pattern. In this way I start articles about behavioral design patterns. These kind of patterns represent some schemas of interaction between objects to make a code more flexible and well organized.The most essential point of this approach is loose coupling between objects. The Strategy should be used when you have several ...

Read More »

Singleton Design Pattern – A Lion’s Eye View

java-logo

A few days ago when I was in my home town, one of my sub-juniors from my colleague attended an interview in an MNC and was severely injured in that interview process. I mean he could not qualify the interview because of the difficult questions fired by the interview panel. When I came back to Bangalore, he shared the embarrassing ...

Read More »

Design Patterns: Prototype

java-logo

The one of creational design patterns is a Prototype design pattern. Despite that the Prototype is the creational pattern it distinguishes from other patterns by a concept. I mean that the Prototype in some sense creates itself. I’m going to explain it bellow. All magic of the Prototype pattern is based on a clone() method of a java Object. So ...

Read More »

Builder Pattern: Good for code, great for tests

java-logo

I’ve found the builder design pattern occasionally useful in code, but frequently useful in tests. This article is a quick summary of the pattern in general, followed by look at a working example of using it in tests. See the code in github. Background to the Builder pattern According to the GoF book, the builder design pattern is used to ...

Read More »

Design Patterns: Builder

java-logo

Sometimes there is a need to create a complex object in application. The one solution for this is a Factory pattern, the another one is a Builder design pattern. In some situation you even can combine these two patterns. But in this article I want to examine the Builder design pattern. The first thing which I need to say that ...

Read More »

Factory Design Pattern – An Effective Approach

java-logo

As you know the Factory Method Pattern or popularly known as the Factory Design Pattern is one the design patterns under the category of “Creational Design Pattern”. The basic principle behind the pattern is that at runtime we get an object of similar type based on the parameter we pass. There are many articles on this pattern and developers implement ...

Read More »

Factory Method pattern in Java

java-logo

In my previous post about the Template Method pattern, I showed how one can leverage lambda expression and default methods. In this post I will explore about factory method pattern and see how one can leverage method references, another feature added in Java 8 alongside lambda expressions. Lets consider a Vehicle interface and 2 of its implementations namely Car and ...

Read More »

Code Refactoring vs Architecture Refactoring

software-development-2-logo

Introduction Everybody knows the meaning of Refactoring; the base of Agile Programming, and the best way to continuously increase the code quality. But Refactoring is not always the same, two different categories can be defined: Code refactoring Architecture refactoring Code refactoring vs Architecture Refactoring The term Architecture Refactoring started to be used in the last years, bringing some confusion about its ...

Read More »

Building smart Builders

java-logo

When building an API, you should always think about who is going to use it. When the API is simply and clear to use, then the users are happy. When the users are happy then everyone is happy too. But great usability is not always easy to achieve. There are patterns that help on this, on this post I will ...

Read More »

Train Wreck Pattern – A much improved implementation in Java 8

java-logo

Venkat Subramaniam at a talk today mentioned about Cascade Method pattern or Train Wreck pattern which looks something like:                   >someObject.method1().method2().method3().finalResult() Few might associate this with the builder pattern, but its not the same. Anyways lets have a look at an example for this in Java with out the use of lambda ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close