Home » #javabasics

#javabasics

Pseudo-Random Number Generators

Java 17 introduced enhancements to the Pseudo-Random Number Generators (PRNGs) to make working with random numbers in Java more versatile and user-friendly. These improvements provide better support for using multiple PRNG algorithms and properly handling stream-based operations. Here’s an overview of the enhancements: 1. PRNG Enhancements: Java 17 introduces a new interface type called RandomGenerator […]

Pseudo-Random Number Generators Read More »

Java 17: A Brief Overview of Features and Enhancements

Java 17 LTS is the latest release providing long-term support for the Java SE platform. According to the Oracle No-Fee Terms and Conditions License, JDK 17 binaries are permissible for use in production and can be redistributed without any associated costs. The abbreviation “LTS” denotes “long-term support,” and this release is slated for availability on

Java 17: A Brief Overview of Features and Enhancements Read More »

Visitor Pattern

In the Visitor pattern, we employ a visitor class to alter the execution algorithm of an element class. This flexibility allows the element’s execution algorithm to adapt as the visitor changes. This pattern falls under the behavior pattern category. In accordance with this pattern, an element object must accept the visitor object, enabling the visitor

Visitor Pattern Read More »

Template Method

The Template Method is a behavioral design pattern that defines a blueprint for an algorithm in a superclass but allows specific steps of the algorithm to be overridden by subclasses without changing its core structure. Consider developing a data mining application that analyzes corporate documents in various formats (PDF, DOC, CSV) to extract meaningful data.

Template Method Read More »

State Pattern

The State Pattern is a behavioral design pattern that allows an object to alter its behavior when its internal state changes. The pattern encapsulates states as separate classes and delegates the state-specific behavior to these classes. This makes it easy to add new states and modify the behavior of an object without altering its structure.

State Pattern Read More »

Memento Pattern

The Memento pattern also known as Token is a behavioral design concept that enables the preservation and retrieval of an object’s prior state discreetly, without exposing the details of its internal structure and implementation. Imagine creating a text editor app with an undo feature. To save states for undo, the app records object states before

Memento Pattern Read More »

Mediator Pattern

The Mediator pattern, also known as the Intermediary or Controller, helps manage communication between different objects. It stops objects from talking to each other directly and makes them talk only through a mediator. This keeps things more organized and prevents messy connections between objects. In air traffic control systems multiple aircraft need to coordinate their

Mediator Pattern Read More »

Iterator Pattern

The Iterator Pattern also known as Cursor is a behavioral design pattern that provides a way to access elements of an aggregate object (such as a collection) sequentially without exposing the underlying representation of that object. It is used to traverse a container of elements, allowing clients to access its elements without needing to know

Iterator Pattern Read More »

Command Pattern

The Command Pattern, alternatively referred to as the Action or Transaction pattern, belongs to the category of behavioral design patterns. It involves the conversion of a request into an independent object that encapsulates all relevant information about the request. This transformation enables the passing of requests as method arguments, facilitates the postponement or queuing of

Command Pattern Read More »

Scroll to Top