Explore an extensive glossary of key terms and concepts related to Java design patterns, providing clear definitions and practical examples for developers.
Welcome to the Glossary of Terms for “Design Patterns in Java: Building Robust Applications.” This section serves as a quick reference guide, providing clear definitions and explanations of key terms and concepts used throughout the book. Whether you’re revisiting a concept or encountering it for the first time, this glossary is designed to enhance your understanding and application of design patterns in Java.
Abstraction
Abstraction involves simplifying complex reality by modeling classes that are appropriate to the problem. It allows developers to focus on interactions at a higher level without needing to manage all the details. For example, an abstract class in Java can define methods that must be implemented by its subclasses, providing a template for future development.
See also: 1.2.4 Abstraction.
Adapter Pattern
A structural design pattern that allows incompatible interfaces to work together. It acts as a bridge between two incompatible interfaces by converting the interface of a class into another interface that a client expects.
See also: 3.1 Adapter Pattern.
Behavioral Patterns
These patterns are concerned with algorithms and the assignment of responsibilities between objects. They help in defining how objects interact in a system and how responsibilities are distributed among them. Examples include Strategy, Observer, and Command patterns.
See also: Chapter 4: Behavioral Design Patterns.
Builder Pattern
A creational design pattern that provides a way to construct a complex object step by step. It allows for the creation of different representations of an object using the same construction process.
See also: 2.4 Builder Pattern.
Chain of Responsibility Pattern
A behavioral design pattern that allows passing requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.
See also: 4.7 Chain of Responsibility Pattern.
Composite Pattern
A structural design pattern that allows you to compose objects into tree structures to represent part-whole hierarchies. It lets clients treat individual objects and compositions of objects uniformly.
See also: 3.3 Composite Pattern.
Creational Patterns
These patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. They help make a system independent of how its objects are created, composed, and represented. Examples include Singleton, Factory Method, and Abstract Factory patterns.
See also: Chapter 2: Creational Design Patterns.
Coupling
Refers to the degree of interdependence between software modules. Low coupling is often a sign of a well-structured computer system and a good design, making the system easier to understand and modify.
See also: 1.2.5.5 Dependency Inversion Principle.
Decorator Pattern
A structural design pattern that allows behavior to be added to individual objects, either statically or dynamically, without affecting the behavior of other objects from the same class.
See also: 3.2 Decorator Pattern.
Dependency Injection (DI)
A technique in which an object receives other objects that it depends on, called dependencies. It is a form of Inversion of Control (IoC) and is used to achieve loose coupling between software components.
See also: 6.1 Dependency Injection.
Encapsulation
Encapsulation is the bundling of data with the methods that operate on that data. It restricts direct access to some of an object’s components, which can prevent the accidental modification of data.
See also: 1.2.1 Encapsulation.
Enum Singleton
A Singleton pattern implementation using Java’s enum type, which is a thread-safe and serialization-safe way to implement singletons.
See also: 2.1.5 Using Enums for Singletons.
Facade Pattern
A structural design pattern that provides a simplified interface to a complex subsystem. It defines a higher-level interface that makes the subsystem easier to use.
See also: 3.4 Facade Pattern.
Factory Method Pattern
A creational design pattern that provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created.
See also: 2.2 Factory Method Pattern.
Inheritance
A mechanism in Java where one class is allowed to inherit the features (fields and methods) of another class. It promotes code reuse and method overriding.
See also: 1.2.2 Inheritance.
Interface Segregation Principle (ISP)
One of the SOLID principles, ISP states that no client should be forced to depend on methods it does not use. It suggests creating smaller, more specific interfaces rather than a large, general-purpose one.
See also: 1.2.5.4 Interface Segregation Principle.
Lambda Expression
A feature introduced in Java 8 that allows you to express instances of single-method interfaces (functional interfaces) more compactly. They enable functional programming in Java.
See also: 1.3.4 Lambda Expressions and Functional Interfaces.
Liskov Substitution Principle (LSP)
A principle in object-oriented programming that states that objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program.
See also: 1.2.5.3 Liskov Substitution Principle.
Model-View-Controller (MVC) Pattern
An architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components handles specific development aspects of an application.
See also: 7.4.1 Model-View-Controller (MVC) Pattern.
Observer Pattern
A behavioral design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.
See also: 4.2 Observer Pattern.
Open/Closed Principle (OCP)
A software design principle that states that software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.
See also: 1.2.5.2 Open/Closed Principle.
Polymorphism
The ability of different classes to be treated as instances of the same class through inheritance. It allows methods to do different things based on the object it is acting upon, even though they share the same name.
See also: 1.2.3 Polymorphism.
Prototype Pattern
A creational design pattern that allows cloning of objects, even complex ones, without coupling to their specific classes.
See also: 2.5 Prototype Pattern.
Singleton Pattern
A creational design pattern that ensures a class has only one instance and provides a global point of access to it.
See also: 2.1 Singleton Pattern.
SOLID Principles
A set of five design principles intended to make software designs more understandable, flexible, and maintainable. They include Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion principles.
See also: 1.2.5 SOLID Principles.
State Pattern
A behavioral design pattern that allows an object to alter its behavior when its internal state changes. The object will appear to change its class.
See also: 4.5 State Pattern.
Strategy Pattern
A behavioral design pattern that enables selecting an algorithm’s behavior at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable.
See also: 4.1 Strategy Pattern.
Template Method Pattern
A behavioral design pattern that defines the skeleton of an algorithm in a method, deferring some steps to subclasses. It lets subclasses redefine certain steps of an algorithm without changing its structure.
See also: 4.6 Template Method Pattern.
UML (Unified Modeling Language)
A standardized modeling language consisting of an integrated set of diagrams, used to visualize the design of a system. UML is often used in software engineering to represent the structure and behavior of a system.
This glossary is designed to be a living document that evolves with the field of software development. As you continue your journey in mastering design patterns in Java, refer back to this glossary for quick definitions and insights into the key concepts that will help you build robust applications.