1602637487
Today, I will discuss a relatively simple and very commonly used behavioral design pattern called — Iterator Design Pattern. Iterator Pattern provides a simple way to iterate through the collection of objects.
Here, the aggregate is nothing but the container/collection which offers Iterator to traverse itself.
#java #design pattern
1623835440
Starting from **Creational Design Pattern, **so wikipedia says “creational design pattern are design pattern that deals with object creation mechanism, trying to create objects in manner that is suitable to the situation”.
The basic form of object creations could result in design problems and result in complex design problems, so to overcome this problem Creational Design Pattern somehow allows you to create the object.
Builder is one of the** Creational Design Pattern**.
Builder is useful when you need to do lot of things to build an Object. Let’s imagine DOM (Document Object Model), so if we need to create the DOM, We could have to do lot of things, appending plenty of nodes and attaching attributes to them. We could also imagine about the huge XML Object creation where we will have to do lot of work to create the Object. A Factory is used basically when we could create the entire object in one shot.
As **Joshua Bloch (**He led the Design of the many library Java Collections Framework and many more) – “Builder Pattern is good choice when designing the class whose constructor or static factories would have more than handful of parameters”
#java #builder #builder pattern #creational design pattern #design pattern #factory pattern #java design pattern
1600135200
OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE). It contains the virtual machine, the Java Class Library, and the Java compiler. The difference between the Oracle OpenJDK and Oracle JDK is that OpenJDK is a source code reference point for the open-source model. Simultaneously, the Oracle JDK is a continuation or advanced model of the OpenJDK, which is not open source and requires a license to use.
In this article, we will be installing OpenJDK on Centos 8.
#tutorials #alternatives #centos #centos 8 #configuration #dnf #frameworks #java #java development kit #java ee #java environment variables #java framework #java jdk #java jre #java platform #java sdk #java se #jdk #jre #open java development kit #open source #openjdk #openjdk 11 #openjdk 8 #openjdk runtime environment
1624549500
In software engineering, the composite pattern is a partitioning design pattern. The composite pattern describes a group of objects that are treated the same way as a single instance of the same type of object. The intent of a composite is to “compose” objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly.
…
#design-patterns #java #code #composite-design-pattern #tutorial #composite design pattern — java
1624442280
In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a _factory method _— either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes — rather than by calling a constructor.
#factory-design-pattern #code #tutorial #design-patterns #java #factory design pattern — java
1596720944
In this blog, we will discuss Proxy Design Pattern, its example, and how it is different from the other design patterns. But, it’s important to have an understanding of the design patterns first. You can refer here.
A Proxy is something that has the authority to do some activity on behalf of the original object. For example, when you are busy for the day and you have to pay electricity bill. So, your approach would be like you will ask someone else to pay on behalf of you.
In the proxy patterns, a class represents the functionality of another class. These type of design patterns comes under structural patterns. Here, we create an object having original object to interface its functionality to outer world.
This proxy is helpful when we don’t want to manipulate our main object. It avoids the duplication of objects so less memory is used which turns out to increases the performance of the application. And one of the advantages of Proxy pattern is good security.
Let’s see how to write a program using the Proxy Pattern.
So we start by creating a simple interface.
public interface College {
public void attendance(String student) ;
}
#functional programming #java #tech blogs #design pattern #functional java #java #proxy design pattern