Browse Chunks
Showing 5551-5600 of 7392 chunks
The Null Object pattern provides a do-nothing implementation of an interface that can be used in place of a real object. It eliminates the need for explicit null checks, reducing boilerplate and preventing null‑reference errors. It is employed when a component may be optional but the surrounding code expects an object conforming to a contract.
Define a neutral implementation → inject where a real implementation may be absent
The practice of encapsulating a collection within a class to control access and encapsulate behavior related to the collection.
private collection field → add/remove methods → read‑only accessor
Replace a type code field with subclasses, where each subclass implements the behavior associated with a particular type code value. This eliminates repetitive conditional statements that depend on the type code, reducing duplication and the risk of missing cases when new types are added. It is applied when a class uses a field or variable to indicate a type and selects behavior via switch or if‑else chains on that field.
Replace type code field with subclasses, each overriding behavior.
A code smell indicating that a method or function is excessively long, making it hard to understand, maintain, and test.
detect long method → apply Extract Method refactoring → achieve clearer code
Refers to identical or nearly identical code sequences that appear more than once within a codebase, often indicating a need for refactoring.
detect duplicate code → extract shared logic → apply DRY principle
Feature Envy is a code smell where a method accesses the data of another object more than its own data, indicating poor encapsulation. It violates the principle of keeping related data and behavior together, leading to fragile code that breaks when the envied class changes. Developers reach for this concept during refactoring to identify methods that should be moved to the class they envy.
Recognize when a method in class A uses more attributes/methods of class B than its own.
A control flow statement that allows multi-way branching based on the value of an expression, executing different code blocks depending on matching cases.
switch selector { case case_label: statements break; // additional cases ... default: statements break; }
A code smell where two or more variables are frequently grouped together in method signatures, fields, or local variables, indicating they should be encapsulated into a single object.
detect data clump → create a value object or parameter object → replace multiple parameters with the new object
Primitive Obsession is a code smell where primitive data types (such as strings, integers, or floats) are used excessively to represent domain concepts that would be better modeled as small objects, causing scattered validation and behavior logic.
Detect overuse of primitive types for domain concepts → extract dedicated value objects → replace primitive usages
A class that does too little, often delegating all its work to other classes or containing little behavior, indicating a potential design smell.
Detect a class with minimal behavior → consider merging it into a more cohesive class or removing it.
A code smell where a client calls a method on an object returned by another method, resulting in a long chain of method calls that indicates poor encapsulation and violates the Law of Demeter.
object.getX().getY().doSomething()
A Middle Man (or Middleware) is an intermediary component that sits between two parties (e.g., client and server) to intercept, process, and forward requests or responses, often adding cross‑cutting concerns such as logging, authentication, or transformation without altering the core business logic.
client request → middleware (e.g., logging, authentication) → core handler → response
A code smell where a subclass does not use the behavior inherited from its superclass, often overriding a method to throw an exception or return a default, indicating that inheritance is inappropriate.
Subclass overrides a parent method but does not use the inherited behavior (e.g., throws UnsupportedOperationException).
The presentation layer is the part of an application responsible for rendering user interfaces and handling user interactions. It separates UI concerns from business logic, making the system easier to maintain and evolve. Developers reach for this layer when they need to display data to users or collect input through views, templates, or UI components.
define UI components → bind to model data → handle user events
The part of a software system that contains the business rules, workflows, and domain logic, distinct from user interface and data storage concerns.
Define business rules → implement in Business Logic Layer → expose via service interfaces
A layer of an application that contains business logic, coordinating between presentation and data access layers.
controller → request → service layer → business logic → repository
The domain layer encapsulates the core business logic and domain model, including entities, value objects, services, and repositories, isolated from infrastructure concerns.
Define entities, value objects, and domain services; expose repository interfaces for persistence
A persistence layer is a software layer responsible for storing and retrieving data from a persistent storage system such as a database or file system.
noun+noun compound
A software architecture pattern where concerns are organized in concentric layers, with the core domain at the center and outer layers depending only on inner layers, promoting separation of concerns and independence of concerns.
Concentric layers: Infrastructure → Application Core → Domain Entities (inner) → Interfaces → Frameworks/Drivers (outer).
A software architectural pattern that separates an application into three interconnected components: Model (data and business logic), View (presentation/UI), and Controller (input handling).
Tripartite separation of concerns into Model, View, and Controller components.
An API gateway is a server that acts as an API front‑end, receiving API requests, enforcing throttling and security policies, passing requests to the back‑end services, and returning the response.
client request → API gateway → authentication/authorization → routing → backend service
A service mesh is a dedicated infrastructure layer for handling service-to-service communication in a microservices architecture, providing traffic management, security (e.g., mTLS), and observability (metrics, tracing, logging).
Deploy a service mesh → sidecar proxies intercept traffic → enforce mTLS and routing policies
A Database per Service pattern assigns each microservice its own dedicated database. It isolates data ownership, preventing cross‑service data coupling and reducing the blast radius of schema changes. It is used when services need independent scaling, deployment, or strict data encapsulation.
service → dedicated database → isolated data management
CRUD refers to the four basic operations—Create, Read, Update, Delete—used to manage data in a database or persistent store. It addresses the need for a standardized way to interact with data entities, reducing boilerplate and inconsistency. Developers reach for CRUD when building APIs, admin interfaces, or any application that requires data manipulation.
Define endpoints for Create, Read, Update, and Delete operations on a resource.
Standardized numeric codes returned by an HTTP server to indicate the outcome of an HTTP request.
three-digit numeric code
OpenAPI specification is a language-agnostic format for describing RESTful APIs. It enables developers to define endpoints, request/response schemas, authentication methods, and error codes in a single YAML or JSON document. Teams use it to generate client SDKs, server stubs, and interactive documentation, reducing integration errors and ensuring contract consistency.
define API endpoints and schemas → generate client/server code → validate requests and responses against spec
A branch in version control used to prepare a release candidate, containing code that is ready for final testing before release.
noun + noun + noun
A branch used to integrate and test changes before promoting them to a more stable branch (e.g., staging or production).
Create promotion branch → merge feature branches → run integration tests → merge to main
The practice of using software tools to execute tests automatically, reducing manual effort and increasing repeatability and reliability of testing.
write test cases → execute them automatically → receive pass/fail feedback
The practice of automating the compilation, testing, packaging, and deployment of software builds to ensure consistent, repeatable, and reliable software delivery.
plan build automation → configure build tool → execute compile, test, and package steps
A server that automates the integration of code changes by running builds and tests continuously.
configure CI server → trigger builds on each commit → collect test results
Defining and managing CI/CD pipelines as code (e.g., YAML DSL) rather than via manual UI configuration.
Define pipeline in YAML → commit to version control → CI system triggers builds
A release management strategy that maintains two identical production environments (blue and green) to enable zero-downtime releases and instant rollback by switching traffic between them.
Adjective-noun compound (color adjective + noun)
A deployment strategy where updates are rolled out gradually to a subset of instances to minimize downtime and risk.
adjective + noun
Feature flagging is a software development practice that enables toggling features on or off without deploying new code, allowing safe rollouts, experimentation, and rollback.
feature flag pattern
A software release strategy where a new feature is deployed to production but hidden from most users, typically via feature flags or percentage rollouts, to test in real conditions without broad exposure.
adjective + noun
A software release strategy that gradually rolls out features to increasing percentages of users or infrastructure, allowing for monitoring and feedback before full rollout.
Gradual rollout of features to increasing user segments using feature flags or traffic splitting.
The practice of packaging software applications and their dependencies into isolated, portable containers that run consistently across different computing environments.
Write Dockerfile → build image → run container
The systematic handling of changes to a system's configuration to maintain integrity and traceability of its configuration items over time.
identify configuration items → record baseline → track changes → audit revisions
A style of configuration where the desired state of a system is declared rather than the steps to achieve it.
declare desired state → let the system reconcile to that state
An operation that can be applied multiple times without changing the result beyond the initial application.
design API endpoints as idempotent → allow safe retries → ensure consistent state
Ensuring that development, testing, and production environments are identical in terms of OS, libraries, configuration, and data to avoid environment-specific issues.
environment parity
Infrastructure that is version‑controlled, enabling reproducible, auditable, and rollback‑capable deployment of systems.
adjective + noun
The process of monitoring data or model behavior over time to detect statistically significant changes (drift) that may indicate degraded model performance.
monitor data distribution → detect statistical shift → trigger alert or retraining
Policy as code defines and manages organizational policies (such as security, compliance, or operational rules) using source code that can be version‑controlled, tested, and automated. It addresses the pain point of manual policy enforcement, which is error‑prone, difficult to audit, and prone to drift across environments. Teams reach for this approach when they need consistent, reproducible policy governance in infrastructure‑as‑code, CI/CD pipelines, or cloud platforms.
define policies in code → version control → automated enforcement
A Git command used to create, list, or delete tags, which are refs that point to specific commits and are commonly used to mark release points.
git tag [options] tag_name [commit]
A branch in version control created to prepare for a software release, allowing stabilization and final testing before merging to main.
create release branch → stabilize code → merge release branch into main
A branching strategy in version control where developers create a short-lived branch for each feature, work in isolation, and merge back to the main branch after review.
plan feature → create branch → develop → open pull request → merge
Continuous Delivery is a software engineering practice that automatically builds, tests, and prepares every code change for release to production. It addresses the pain of manual, error‑prone release processes by providing a reliable, repeatable pipeline. Teams adopt it when they need to ship features quickly while maintaining high quality.
commit → automated build → test suite → deploy to staging → promote to production