> For the complete documentation index, see [llms.txt](https://devansh233.gitbook.io/design-patterns-and-principles/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devansh233.gitbook.io/design-patterns-and-principles/master.md).

# Design Patterns and Principles

![](https://raw.githubusercontent.com/Devansh-Maurya/Design-Patterns-And-Principles/master/Design%20Patterns%20%26%20Principles.png)

### What are Design Principles?

**A design principle is a basic tool or technique that can be applied to designing or writing code to make that code more maintainable, flexible, or extensible.**

[Explore the Design Principles on this website](/design-patterns-and-principles/design-principles.md)

### What are Design Patterns?

**A design pattern is a solution to a problem in a context.**

* The **context** is the situation in which the pattern applies. This should be a recurring situation.
* The **problem** refers to the goal you are trying to achieve in this context, but it also refers to any constraints that occur in the context.
* The **solution** is what you’re after: a general design that anyone can apply which resolves the goal and set of constraints.

If you find yourself in a context with a problem that has a goal that is affected by a set of constraints, then you can apply a design that resolves the goal and constraints and leads to a solution.

[Explore the Design Patterns on this website](/design-patterns-and-principles/design-patterns.md)

**Credits:** This repo is a collection of the notes I made while reading the book **Head First Design Patterns**. The Head First Design Patterns book is a great read if you are just starting to learn design patterns or if you want to learn patterns in a non-boring and non-academic way.
