Home » Tag Archives: Design Patterns (page 8)

Tag Archives: Design Patterns

Chain Of Responsibility Design Pattern Example

java-logo

Avoid coupling the sender of a request to the receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. The main intention in Chain Of Responsibility is to decouple the origin of the request and the handling of the request such ...

Read More »

10 Object Oriented Design principles for the Java programmer

software-development-2-logo

Object Oriented Design Principles are core of OOPS programming but I have seen most of Java programmer chasing design patterns like Singleton pattern , Decorator pattern or Observer pattern but not putting enough attention on Object oriented analysis and design or following these design principles. I have regularly seen Java programmers and developers of various experience level who either doesn’t ...

Read More »

Builder Design pattern in Java

java-logo

Builder design pattern in Java is a creational pattern i.e. used to create objects, similar to factory method design pattern which is also creational design pattern. Before learning any design pattern I suggest find out the problem a particular design pattern solves. Its been well said necessity is mother on invention. learning design pattern without facing problem is not that ...

Read More »

Chain of Responsibility Pattern in Java

java-logo

Chain of Responsibility design pattern is needed when a few processors should exist for performing an operation and a particular order should be defined for those processors. Also the changeability of the order of processors on runtime are important.UML represantation of the pattern is as below: Handler defines the general structure of processor objects. ‘HandleRequest’ here is the abstract processor ...

Read More »

Testing Abstract Classes and Template Method Pattern

java-interview-questions-answers

From wikipedia “A template method defines the program skeleton of an algorithm. One or more of the algorithm steps can be overridden by subclasses to allow differing behaviors while ensuring that the overarching algorithm is still followed”. Typically this pattern is composed by two or more classes, one that is an abstract class providing template methods (non-abstract) that have calls ...

Read More »

Solving a Producer-Consumer Problem in Java

java-logo

The producer-consumer problem is one of the most frequently encountered problems when we attempt multi threaded programming. While not as challenging as some of the other problems in multi-threaded programming, an incorrect implementation of this problem can create a mess of your application. Produced items will be left unconsumed, starting items will be skipped, consumption depends on whether the production ...

Read More »

The Visitor Pattern Re-visited

java-logo

The visitor pattern is one of the most overrated and yet underestimated patterns in object-oriented design. Overrated, because it is often chosen too quickly (possibly by an architecture astronaut), and then bloats an otherwise very simple design, when added in the wrong way. Underestimated, because it can be very powerful, if you don’t follow the school-book example. Let’s have a ...

Read More »

Implementing the State Machine Pattern as a Stream Processor

java-logo

In my last blog, I said that I really thought that some of the Gang Of Four (GOF) patterns were becoming somewhat obsolete, and if not obsolete then certainly unpopular. In particular I said that StateMachine wasn’t that useful as you can usually think of another, simpler way of doing whatever it is you’re doing rather than using it. In ...

Read More »

Java EE Revisits Design Patterns: Observer

java-logo

Aside from being implemented in many languages and many applications, Observer Pattern has been a part of Java since version 1.0. Observer Pattern is also a good implementation of Hollywood Principle. Just like Agents in Hollywood like to callback the candidates for a role instead of being called daily to be asked about available jobs, most of the server side ...

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