Home » #javabasics » Page 3

#javabasics

Abstract Factory Pattern

The Abstract Factory pattern is a powerful design tool that facilitates the creation of families of related objects without specifying their concrete classes. By providing an abstract interface for creating objects, this pattern enables the creation of object hierarchies with consistent structure. In Factory Method, we implemented furniture business to deliver different types furniture. Now […]

Abstract Factory Pattern Read More »

Java Design Patterns

Design patterns are like handy guides for solving common problems in how we create software. They’re a bit like ready-to-use templates that can be adjusted to fit the specific issues we face in our code.Remember, you can’t just grab a pattern and insert it exactly into your program, like using pre-made tools. A pattern isn’t

Java Design Patterns Read More »

Java 8 Stream API

The Stream API, which was introduced with the release of Java 8, serves as a powerful tool for processing collections of objects. A stream in Java represents a sequence of objects and offers a range of methods that can be efficiently chained together to achieve specific outcomes. Key aspects of the Java stream feature include:

Java 8 Stream API Read More »

Java Lambda Expressions

Java Lambda Expressions (a.k.a. lambda functions) have been a game-changer in the world of Java programming since their introduction in Java 8. These expressions provide a concise and expressive way to define anonymous functions, which are functions that don’t have a name and can be treated as values. Lambda expressions are closely related to functional

Java Lambda Expressions Read More »

Function Interface

The java.util.function.Function interface stands as one of the valuable functional interfaces (an interface that contains only one abstract method). It is a key component of the Java 8 functional programming API. It  provides a way to define and manipulate functions in Java code. Why Function Interface? You can use the function interface to create new functions or

Function Interface Read More »

Observer design pattern

In Java, the Observer pattern establishes a one-to-many dependency relationship among objects. As name suggest, we have 2 object: observer (there can be multiple observer) and observable. When an observable object changes its state, all registered observers are notified and updated automatically. This design promotes loose coupling, contributing to code maintainability and flexibility. Benefits The

Observer design pattern Read More »

Scroll to Top