Sometimes we may want to access indirectly to an object, via a substitute. That substitute is called Proxy. The Proxy Pattern helps us deal with a proxy object and talk to the actual object. In this tutorial, we’re gonna look at 2 ways to implement Proxy Pattern in Node.js:
- Using custom Proxy Class
- Using Proxy API
[Continue reading…] “Ways to implement Proxy Pattern in Node.js”
Dependency Injection is one form of Inversion of Control technique that supports the Dependency Inversion principle (the last one of SOLID Principles – decoupling software modules). In this tutorial, we’re gonna look at way to implement Dependency Injection pattern in Node.js.
[Continue reading…] “How to implement Dependency Injection in Node.js with Example”
When we want to create complicated object which has multiple parts, we can use Builder Pattern that separates the building of these parts. This creational process does not care about how these parts are assembled.
In this tutorial, we’re gonna look at 2 ways to implement Builder Pattern in Node.js:
- using Builder function
- using Builder class
[Continue reading…] “How to implement Builder Pattern in Node.js”
Instead of using class constructors or
new keyword to create an object of a class, we can abstract this process. So, we can determine the type of object at run-time, by the time of generating that class object. The implementation seems like Factory Method, but simpler than Factory Method. This simple Factory is not treated as a standard GoF design pattern, but the approach is common to any place where we want to separate the code that varies a lot from the code that does not vary.
In this tutorial, grokonez shows you how to do it in NodeJs.
[Continue reading…] “How to implement simple Factory Pattern in Node.js”
In many cases, creating a new instance is a costly operation. Fortunately, we can copy or clone an instance of an existing one instead of creating from scratch. This approach can be done by using Prototype Pattern, one of Creational Patterns.
[Continue reading…] “Java Prototype Pattern tutorial with example”
Chain of Responsibility Pattern is a Behavioral Pattern in which, a Request is sent through a chain of handling Objects without knowing which Object will handle it. With Chain of Responsibility Pattern, we can avoid coupling the Sender of a request to received Objects and create a processing sequence automatically based on type of request.
[Continue reading…] “Chain of Responsibility Pattern in Java”
Decorator Pattern is a Structural Pattern in which, functionality can be added to an existing object without changing its structure.
[Continue reading…] “Decorator Pattern in Java”
Facade Pattern is a Structural Pattern in which, a set of interfaces is gathered into only one interface that Client can work easily and simply. Facade Pattern helps us to wrap complexities of components inside and lose coupling between Client and subSystems.
[Continue reading…] “Facade Pattern in Java”
Adapter Pattern is a Structural Pattern in which, an interface of a class is converted into another interface that Client expects to work. With Adapter Pattern, we can reuse existing code without changing it.
[Continue reading…] “Adapter Pattern in Java”
Observer Pattern is a Behavioral Pattern in which, an Object (we call it Subject) contains a list of dependency Objects (we call them Observers). Observers will be notified and updated automatically whenever Subject changes its state. Today we’re gonna look at how Observer Pattern in Java works.
[Continue reading…] “Observer Pattern in Java”
Builder Pattern is under creational pattern for building a complex object in software development. JavaSampleApproach introduces reasons and how to program with Builder Pattern.
[Continue reading…] “Java Design Pattern – Builder Pattern”
Abstract factory pattern is a Super-Factory of a group familiar factories. We can use it to expose API for integration code and hidden the logic implementation. Abstract Factory gives us a way to manage and decouple design in case Program has more than one Factory having the same Interface.
The tutorial will guide you a sample for how to program with Abstract Factory Pattern.
[Continue reading…] “Java Design Pattern – Abstract Factory Pattern”