Browse Chunks

Showing 5551-5600 of 7392 chunks

Introduce Null Object
CAT_9

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

Encapsulate Collection
CAT_9

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 Type Code with Subclasses
CAT_9

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.

Long Method
CAT_9

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

Duplicate Code
CAT_9

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
CAT_9

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.

Switch Statements
CAT_9

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; }

Data Clumps
CAT_9

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
CAT_9

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

Lazy Class
CAT_9

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.

Message Chains
CAT_9

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()

Middle Man
CAT_9

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

Refused Bequest
CAT_9

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).

Presentation layer
CAT_1

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

Business logic layer
CAT_1

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

Service layer
CAT_1

A layer of an application that contains business logic, coordinating between presentation and data access layers.

controller → request → service layer → business logic → repository

Domain layer
CAT_1

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

Persistence layer
CAT_1

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

Onion architecture
CAT_1

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).

Model-View-Controller
CAT_1

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.

API Gateway
CAT_1

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

Service Mesh
CAT_1

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

Database per Service
CAT_1

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
CAT_2

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.

HTTP status codes
CAT_2

Standardized numeric codes returned by an HTTP server to indicate the outcome of an HTTP request.

three-digit numeric code

OpenAPI specification
CAT_2

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

release candidate branch
CAT_8

A branch in version control used to prepare a release candidate, containing code that is ready for final testing before release.

noun + noun + noun

promotion branch
CAT_8

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

automated testing
CAT_8

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

build automation
CAT_8

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

continuous integration server
CAT_8

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

pipeline as code
CAT_8

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

blue-green deployment
CAT_8

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)

rolling update
CAT_8

A deployment strategy where updates are rolled out gradually to a subset of instances to minimize downtime and risk.

adjective + noun

feature flagging
CAT_8

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

dark launch
CAT_8

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

progressive delivery
CAT_8

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.

containerization
CAT_8

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

configuration management
CAT_8

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

declarative configuration
CAT_8

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

idempotent operations
CAT_8

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

environment parity
CAT_8

Ensuring that development, testing, and production environments are identical in terms of OS, libraries, configuration, and data to avoid environment-specific issues.

environment parity

versioned infrastructure
CAT_8

Infrastructure that is version‑controlled, enabling reproducible, auditable, and rollback‑capable deployment of systems.

adjective + noun

drift detection
CAT_8

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
CAT_8

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

git tag
CAT_8

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]

release branch
CAT_8

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

feature branch workflow
CAT_8

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
CAT_8

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

Quick Start
CAT_10