Home » Tag Archives: Design Patterns (page 5)

Tag Archives: Design Patterns

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 »

Template Method Pattern – Using Lambda Expressions, Default Methods

java-logo

Template Method pattern is one of the 23 design patterns explained in the famous Design Patterns book by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides. The intent of this pattern is stated as: Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. TemplateMethod lets subclasses redefine certain steps of an algorithm without changing ...

Read More »

Publish/Subscribe Pattern with Apache Camel

apache-camel-logo

Publish/Subscribe is a simple messaging pattern where a publisher sends messages to a channel without the knowledge of who is going to receive them. Then it is the responsibility of the channel to deliver a copy of the messages to each subscriber. This messaging model enables creation of loosely coupled and scalable systems.             It ...

Read More »

A Theorical Look into Object/Resource Pool Pattern

software-development-2-logo

Definition: Sometimes our software projects need costly object creations (database connections, socket connections, large graphical objects etc.). This cost may be about time and/or memory. Those objects may also be needed to be created frequently. At that moment, Object/Resource Pool pattern comes to help.         Object Pool pattern: Reuses unused costly objects without re-creating those objects (e.g. ...

Read More »

Gang of Four Patterns With Type-Classes and Implicits in Scala

scala-logo

Type-classes, as they’re known within the Scala language, have a wonderful place in library development. They make code open to extension, less verbose and simplify APIs. I’ve yet to find many other patterns in languages which do the same. A close second, depending on your point of view, being one of either the concept of a generator or decorator in ...

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