We should not modify existing tested codes if we can help ourselves. Instead, we could create new codes to wrap around them that provide additional features. Then, present the new codes to the client code as the original codes. That
Design Patterns Are The Ultimate Toolkit For Programmers
Design patterns are the ultimate toolkit for programmers. Furthermore, we use them to create maintainable software. This post goes through the design patterns and provides sample Java codes. The Need For Design Patterns Design patterns are known solutions to common
The Prototype Design Pattern In Simple Words
The Prototype design pattern creates an object that serves as a template when we need copies of it. Then, we slightly modify these copies at runtime by giving them new properties and behaviors. Unlike other design patterns, our usage of
The Iterator Design Pattern Example In Rust
This post shows how to use the Iterator design pattern in Rust without using the Iterator trait or any crate. Suppose we have a struct with multiple collections of various types that implement the same trait. The Iterator Design Pattern
The Composite Design Pattern In Simple Words
The Composite design pattern helps us deal with a type of object – individually or as a group. In other words, our codes should be able to process that object alone. Also, our codes can deal with a collection of
The Singleton Design Pattern In Simple Words
Be mindful when creating objects; sometimes, we only need one of a specific type. Creating a single object that lives throughout the lifetime of a program is a form of Singleton design pattern. As simple as the concept may be,
The Decorator Design Pattern In Simple Words
The Decorator design pattern is an alternative to subclassing that makes our codes flexible and maintainable. Furthermore, it allows us to wrap around existing objects and dynamically modify their behaviors (methods). When To Use This Pattern? When do we use
The Facade Design Pattern In Simple Words
Do you have codes with an overwhelming number of service and DAO methods? Which group of method calls represent which use case? If that is one of the predicaments you are having with your codebase, it is probably wise to
The Visitor Design Pattern In Simple Words
The Visitor design pattern is another behavioral pattern that simplifies access to an object’s data collections. Moreover, it is closely related to the Iterator design pattern. Unlike the Iterator pattern, the Visitor pattern makes client codes visit one data item
The Iterator Design Pattern in Simple Words
The Iterator design pattern is a behavioral design pattern that simplifies access to an object’s data collections. Moreover, it aims to provide a simple mechanism to make the data available. As a result, the client codes do not need to