← Software Design Patterns guideSOURCE EVIDENCEExplore Software Design Patterns
Browse the extracted source moments, including those beyond the guide’s selected citations. Source types are distinct. These are retained paraphrases or structured measurements; check the original source and its limitations.
Browse published, available sources beyond the guide’s selected citations. Narrow by source type or date, or explore the Research library across subjects.
Lex Fridman · 2025-08-29 · ConversationDevelopers should implement assertions organically during initial code construction to test non-negotiable assumptions—such as non-null pointers or absolute bounds—rather than avoiding them out of fear. An assertion failure immediately halts execution and isolates bugs, providing a crucial safety mechanism for identifying invalid runtime states.
Tech Interview Prep with AI-Podcasts · 2025-03-27 · ConversationIn a complex document editor handling high-resolution images, loading every asset up front causes sluggish performance and unresponsiveness. Introducing a lightweight image proxy as a stand-in allows the application to defer loading the heavy image data until the user actually scrolls to it or requests it, implementing lazy initialization to optimize startup time.
CS50 · 2026-01-01 · ConversationDefining custom blocks or functions prevents the need to duplicate identical code sequences across a program, ensuring that adjustments to timing or behavior only need to be implemented in a single centralized location.
Programming with Mosh · 2015-10-15 · ConversationRooted in Martin Fowler's architecture patterns, a repository acts as an in-memory collection of domain objects that mediates between the domain and data mapping layers. This abstraction minimizes duplicate query logic across applications and decouples business logic from specific persistence frameworks.
Programming with Mosh · 2015-10-15 · ConversationPersistence frameworks shift approximately every two years, transitioning through technologies like ADO.NET, LINQ-to-SQL, early Entity Framework, NHibernate, DbContext, and Dapper. Using a repository pattern gives applications the architectural freedom to adopt new persistence mechanisms with minimal disruption to the codebase.
Programming with Mosh · 2015-10-15 · ConversationRepositories should mimic in-memory collections, containing methods for adding, removing, finding, and retrieving objects by ID. They intentionally exclude update and save methods because in-memory collections mutate objects directly through reference changes, leaving persistence execution to other components.
Programming with Mosh · 2015-10-15 · ConversationThe unit of work pattern maintains a list of objects affected by a business transaction and coordinates writing changes across multiple repositories. By housing the save mechanism within the unit of work rather than individual repositories, applications ensure atomic updates across related data stores.
Programming with Mosh · 2015-10-15 · ConversationWhile Entity Framework DbSets and DbContext mimic repositories and units of work on the surface, returning IQueryable forces developers to scatter and repeat LINQ query logic across controllers and services. Encapsulating queries within proper custom repositories prevents these leaky abstractions and maintains clean architecture boundaries.
Programming with Mosh · 2015-10-15 · ConversationComplex architectural patterns such as repositories, dependency injection, and clean layers are unnecessary for short-term proof-of-concept projects with volatile requirements. Engineers should weigh project viability and risk before applying heavy design patterns to prevent wasted development effort.
Know a source we’re missing? Suggest it →
Source availability and coverage can change. No new AI requests are made to browse evidence.