Posts

Types of Design Patterns

Type Design Pattern Description Creational Singleton Ensures a class has only one instance. Factory Method Defines an interface for creating objects but lets subclasses decide the instantiation. Abstract Factory Provides an interface for creating families of related objects. Builder Separates object construction from its representation. Prototype ...

Adapter Design Pattern

Image
The Adapter Design Pattern is a structural design pattern used to allow incompatible interfaces to work together. It acts as a bridge between two incompatible interfaces , helping legacy or third-party systems integrate smoothly without modifying existing code. ✅ Benefits in the Banking Domain 🧩 Interoperability : Easily integrate legacy or third-party systems with your existing banking architecture. 🛡️ Encapsulation : You don’t expose the legacy code or modify it directly. 🔄 Reusability : Allows reuse of old code without rewriting. 🚀 Scalability : Add new adapters as new services/systems are onboarded. 📝 Real-World Scenarios in Banking ...

Java Functional Interface

Image
Java Lambda expression Lambda expression came to enable to use functional programming feature in java. It provides the facility to assign a function into a variable. Lambda expression provides implementation of functional interface. Lambda expression   just like a function. Benefits of Lambda Expression Length of code reduced. Increase the code readability. Java Lambda Expression Syntax (argument-list) -> {body} Java lambda expression is consisted of 3 components. 1) Argument-list:  It can be empty or non-empty as well. 2) Arrow-token:  It is used to link arguments-list and body of expression. 3) Body:  It contains expressions and statements for lambda expression. Java Lambda Expression Example ( ) ->  System.out.println("Welcome"); Output : Welcome   Java Functional Interfaces Functional Interfaces are used to invoke the lambda expression. It help...