{"id":"6b093dc091bd8fbaf2a0c8b2","slug":"specification","title":"Specification: business rules as objects you can combine","summary":"The Specification pattern from Domain-Driven Design: named rules with isSatisfiedBy, combining with and, or and not, one rule for validation and querying, translation to SQL via expression trees, the Criteria API and Q objects. Code in C#, TypeScript, Java, Go and Python.","servedLang":"en","availableLangs":["pl","en"],"topics":["specification","composite","ddd-strategic-design"],"techs":["dotnet","typescript","java","go","python"],"tags":["ddd","specification","business-rules","repository","expression-trees","tactical-patterns"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":12,"stats":{"views":2,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T08:22:24.343Z","updatedAt":"2026-11-27T13:17:51.182Z","requestedLang":"en","theme":{"hero":"classic","heroMedia":null,"accent":"teal","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Specification pattern (DDD): isSatisfiedBy, and/or/not combinators, validation and selection from a repository, Expression<Func<T,bool>> in EF Core, Spring Data JPA Specification, Django Q, Ardalis.Specification, examples in C#, TypeScript, Java, Go and Python.","wordCount":2366,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"A wholesaler sells to companies on trade credit: payment 30 days after delivery. The rule \"who may buy on deferred payment\" sounds simple – a verified company, no overdue invoices, at least six orders in the last year – but it lives in four places: the checkout, the sales panel, the e-mail campaign query and the finance report. Every copy is slightly different. The "},{"type":"text","text":"Specification","marks":[{"type":"bold"}]},{"type":"text","text":" pattern turns such a rule into an object named in the language of the domain that answers one question: does this candidate satisfy it?"}]},{"type":"callout","attrs":{"variant":"tip","title":"In short"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A specification is a "},{"type":"text","text":"predicate with a business name","marks":[{"type":"bold"}]},{"type":"text","text":" – "},{"type":"text","text":"isSatisfiedBy(candidate)","marks":[{"type":"code"}]},{"type":"text","text":" returns "},{"type":"text","text":"true","marks":[{"type":"code"}]},{"type":"text","text":" or "},{"type":"text","text":"false","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Small rules are combined with "},{"type":"text","text":"and, or, not","marks":[{"type":"bold"}]},{"type":"text","text":" into new specifications – the result is a tree, a Composite."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The same specification "},{"type":"text","text":"validates","marks":[{"type":"bold"}]},{"type":"text","text":" a single object and "},{"type":"text","text":"selects","marks":[{"type":"bold"}]},{"type":"text","text":" objects from a repository – and with an expression tree it also becomes a SQL query."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"2003","label":"\"Domain-Driven Design\"","hint":"Eric Evans describes Specification among the patterns that make implicit concepts explicit"},{"value":"3","label":"uses according to Evans","hint":"validation, selection from a collection, building objects to order"},{"value":"3","label":"combinators","hint":"and, or, not – and no new repository methods"}]}},{"type":"heading","attrs":{"level":2,"id":"the-problem-a-rule-scattered-across-the-code"},"content":[{"type":"text","text":"The problem: a rule scattered across the code"}]},{"type":"paragraph","content":[{"type":"text","text":"This is what the trade credit rule looked like after two years of development:"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"trade-credit.before.ts"},"content":[{"type":"text","text":"// checkout\nfunction canBuyOnCredit(c: Customer): boolean {\n  return c.verified && c.taxId != null && c.overdueInvoices === 0 && c.ordersLastYear >= 6;\n}\n\n// e-mail campaign – copied, but someone \"simplified\" it and the SQL drifted away from the code above\nconst audience = await db.query(\n  \"SELECT * FROM customers WHERE verified = true AND orders_last_year >= 5\", // taxId? overdue invoices?\n);\n\n// sales panel – yet another variant, with an extra exception nobody remembers\nconst eligible = customers.filter((c) => (c.verified || c.vip) && c.overdueInvoices === 0);"}]},{"type":"paragraph","content":[{"type":"text","text":"Three copies, three different answers to the same business question. When finance raises the threshold to eight orders, someone will change one place out of three. On top of that the rule has no name – the code shows conditions, but not the concept of \"a customer eligible for trade credit\"."}]},{"type":"heading","attrs":{"level":2,"id":"the-solution-named-rules-and-combinators"},"content":[{"type":"text","text":"The solution: named rules and combinators"}]},{"type":"paragraph","content":[{"type":"text","text":"Every condition becomes a separate specification: "},{"type":"text","text":"VerifiedCompany","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"HasOverdueInvoices","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"RegularBuyer","marks":[{"type":"code"}]},{"type":"text","text":". The shared interface has "},{"type":"text","text":"isSatisfiedBy","marks":[{"type":"code"}]},{"type":"text","text":" plus combinators that return "},{"type":"text","text":"new","marks":[{"type":"bold"}]},{"type":"text","text":" specifications. The credit policy is simply a composition: "},{"type":"text","text":"VerifiedCompany and not HasOverdueInvoices and RegularBuyer","marks":[{"type":"code"}]},{"type":"text","text":". The checkout asks about one customer, the campaign about all of them, but both use the same object."}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"classDiagram\n  direction LR\n  class Specification~T~ {\n    <<interface>>\n    +isSatisfiedBy(candidate) bool\n    +and(other) Specification\n    +or(other) Specification\n    +not() Specification\n  }\n  class AndSpecification\n  class OrSpecification\n  class NotSpecification\n  class VerifiedCompany\n  class HasOverdueInvoices\n  class RegularBuyer\n  Specification <|.. AndSpecification\n  Specification <|.. OrSpecification\n  Specification <|.. NotSpecification\n  Specification <|.. VerifiedCompany\n  Specification <|.. HasOverdueInvoices\n  Specification <|.. RegularBuyer\n  AndSpecification o-- \"2\" Specification\n  OrSpecification o-- \"2\" Specification\n  NotSpecification o-- \"1\" Specification\n  CheckoutService ..> Specification : validates a customer\n  CustomerRepository ..> Specification : selects customers","caption":"Leaf specifications and combinators share one interface – the client cannot tell a simple rule from a composite one"}},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Role"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Responsibility"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"In the example"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Specification"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"the interface: "},{"type":"text","text":"isSatisfiedBy","marks":[{"type":"code"}]},{"type":"text","text":" + combinators"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Specification<T>","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Leaf specification"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"one named business rule"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"VerifiedCompany","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"HasOverdueInvoices","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Combinator"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"combines specifications logically and is a specification itself"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"And","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"Or","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"Not","marks":[{"type":"code"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Client"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"uses specifications to validate, select or build"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"checkout, repository, campaign"}]}]}]}]},{"type":"heading","attrs":{"level":2,"id":"implementation-in-five-languages"},"content":[{"type":"text","text":"Implementation in five languages"}]},{"type":"paragraph","content":[{"type":"text","text":"The C# version builds the specification on an expression tree ("},{"type":"text","text":"Expression<Func<T, bool>>","marks":[{"type":"code"}]},{"type":"text","text":"), so EF Core translates it to SQL. TypeScript and Go show a functional style with rule names, which makes it possible to tell a customer "},{"type":"text","text":"why","marks":[{"type":"italic"}]},{"type":"text","text":" they were refused. Java uses the ready-made "},{"type":"text","text":"Specification<T>","marks":[{"type":"code"}]},{"type":"text","text":" from Spring Data JPA, and Python overloaded operators plus Django's "},{"type":"text","text":"Q","marks":[{"type":"code"}]},{"type":"text","text":"/"},{"type":"text","text":"Exists","marks":[{"type":"code"}]},{"type":"text","text":" objects."}]},{"type":"codeGroup","attrs":{"title":"Trade credit policy"},"content":[{"type":"codeBlock","attrs":{"language":"csharp","filename":"TradeCreditSpecs.cs"},"content":[{"type":"text","text":"// A specification wraps an expression tree, so EF Core can translate it to SQL.\npublic abstract class Specification<T>\n{\n    private Func<T, bool>? _compiled;\n\n    public abstract Expression<Func<T, bool>> ToExpression();\n\n    // In memory: compile once and reuse – compiling on every call is expensive.\n    public bool IsSatisfiedBy(T candidate) => (_compiled ??= ToExpression().Compile())(candidate);\n\n    public Specification<T> And(Specification<T> other) => new Binary(this, other, Expression.AndAlso);\n    public Specification<T> Or(Specification<T> other) => new Binary(this, other, Expression.OrElse);\n    public Specification<T> Not() => new Negation(this);\n\n    private sealed class Binary(Specification<T> left, Specification<T> right,\n        Func<Expression, Expression, BinaryExpression> combine) : Specification<T>\n    {\n        public override Expression<Func<T, bool>> ToExpression()\n        {\n            var l = left.ToExpression();\n            var r = right.ToExpression();\n            var rightBody = new SwapParameter(r.Parameters[0], l.Parameters[0]).Visit(r.Body); // x => l(x) && r(x)\n            return Expression.Lambda<Func<T, bool>>(combine(l.Body, rightBody), l.Parameters);\n        }\n    }\n\n    private sealed class Negation(Specification<T> inner) : Specification<T>\n    {\n        public override Expression<Func<T, bool>> ToExpression()\n        {\n            var e = inner.ToExpression();\n            return Expression.Lambda<Func<T, bool>>(Expression.Not(e.Body), e.Parameters);\n        }\n    }\n\n    private sealed class SwapParameter(ParameterExpression from, ParameterExpression to) : ExpressionVisitor\n    {\n        protected override Expression VisitParameter(ParameterExpression node) => node == from ? to : node;\n    }\n}\n\npublic sealed class VerifiedCompany : Specification<Customer>\n{\n    public override Expression<Func<Customer, bool>> ToExpression() => c => c.Verified && c.TaxId != null;\n}\n\npublic sealed class HasOverdueInvoices : Specification<Customer>\n{\n    public override Expression<Func<Customer, bool>> ToExpression() =>\n        c => c.Invoices.Any(i => !i.Paid && i.DueDate < DateTime.UtcNow);\n}\n\n// The same rule validates one customer and selects customers in the database:\n//   var policy = new VerifiedCompany().And(new HasOverdueInvoices().Not());\n//   if (!policy.IsSatisfiedBy(customer)) throw new TradeCreditRefused(customer.Id);\n//   var audience = await db.Customers.Where(policy.ToExpression()).ToListAsync(ct);"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"trade-credit-specs.ts"},"content":[{"type":"text","text":"// A specification is a named predicate; combinators build new specifications from existing ones.\nexport interface Spec<T> {\n  readonly name: string;\n  isSatisfiedBy(candidate: T): boolean;\n}\n\nexport const spec = <T>(name: string, test: (c: T) => boolean): Spec<T> => ({ name, isSatisfiedBy: test });\n\nexport const and = <T>(...specs: Spec<T>[]): Spec<T> =>\n  spec(specs.map((s) => s.name).join(\" AND \"), (c) => specs.every((s) => s.isSatisfiedBy(c)));\n\nexport const or = <T>(...specs: Spec<T>[]): Spec<T> =>\n  spec(specs.map((s) => s.name).join(\" OR \"), (c) => specs.some((s) => s.isSatisfiedBy(c)));\n\nexport const not = <T>(s: Spec<T>): Spec<T> => spec(`NOT (${s.name})`, (c) => !s.isSatisfiedBy(c));\n\n/** Names of the rules the candidate fails – ready for an error message or a UI hint. */\nexport const unmet = <T>(candidate: T, ...specs: Spec<T>[]): string[] =>\n  specs.filter((s) => !s.isSatisfiedBy(candidate)).map((s) => s.name);\n\ninterface Customer {\n  verified: boolean;\n  taxId?: string;\n  overdueInvoices: number;\n  ordersLastYear: number;\n}\n\nexport const verifiedCompany = spec<Customer>(\"verified company\", (c) => c.verified && !!c.taxId);\nexport const noOverdueInvoices = spec<Customer>(\"no overdue invoices\", (c) => c.overdueInvoices === 0);\nexport const regularBuyer = spec<Customer>(\"6+ orders last year\", (c) => c.ordersLastYear >= 6);\n\nconst creditRules = [verifiedCompany, noOverdueInvoices, regularBuyer];\nexport const tradeCreditPolicy = and(...creditRules);\n\nexport function assertTradeCredit(customer: Customer): void {\n  const missing = unmet(customer, ...creditRules); // validation with a reason\n  if (missing.length) throw new Error(`Trade credit refused: ${missing.join(\", \")}`);\n}\n\nexport const creditAudience = (all: Customer[]) => all.filter((c) => tradeCreditPolicy.isSatisfiedBy(c)); // selection"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"CustomerSpecs.java"},"content":[{"type":"text","text":"// Spring Data JPA: a Specification<T> builds a Criteria API predicate, the repository runs it as SQL.\npublic final class CustomerSpecs {\n    private CustomerSpecs() {}\n\n    public static Specification<Customer> verifiedCompany() {\n        return (root, query, cb) -> cb.and(\n            cb.isTrue(root.<Boolean>get(\"verified\")),\n            cb.isNotNull(root.get(\"taxId\")));\n    }\n\n    public static Specification<Customer> hasOverdueInvoices(LocalDate today) {\n        return (root, query, cb) -> {\n            Subquery<Long> overdue = query.subquery(Long.class);\n            Root<Invoice> invoice = overdue.from(Invoice.class);\n            overdue.select(cb.literal(1L)).where(\n                cb.equal(invoice.get(\"customer\"), root),\n                cb.isFalse(invoice.<Boolean>get(\"paid\")),\n                cb.lessThan(invoice.<LocalDate>get(\"dueDate\"), today));\n            return cb.exists(overdue);\n        };\n    }\n\n    public static Specification<Customer> placedAtLeast(int orders) {\n        return (root, query, cb) -> cb.greaterThanOrEqualTo(root.<Integer>get(\"ordersLastYear\"), orders);\n    }\n}\n\npublic interface CustomerRepository extends JpaRepository<Customer, Long>, JpaSpecificationExecutor<Customer> {}\n\n@Service\nclass TradeCreditService {\n    private final CustomerRepository customers;\n    private final Clock clock;\n\n    TradeCreditService(CustomerRepository customers, Clock clock) {\n        this.customers = customers;\n        this.clock = clock;\n    }\n\n    List<Customer> creditAudience() {\n        Specification<Customer> policy = CustomerSpecs.verifiedCompany()\n            .and(Specification.not(CustomerSpecs.hasOverdueInvoices(LocalDate.now(clock))))\n            .and(CustomerSpecs.placedAtLeast(6));\n        return customers.findAll(policy); // one SQL query with EXISTS, nothing filtered in memory\n    }\n}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"specs.go"},"content":[{"type":"text","text":"package credit\n\nimport \"strings\"\n\n// Spec is a named business rule; generics (Go 1.18+) make the combinators reusable for any type.\ntype Spec[T any] struct {\n\tName string\n\tTest func(T) bool\n}\n\nfunc (s Spec[T]) IsSatisfiedBy(c T) bool { return s.Test(c) }\n\nfunc And[T any](specs ...Spec[T]) Spec[T] {\n\tnames := make([]string, len(specs))\n\tfor i, s := range specs {\n\t\tnames[i] = s.Name\n\t}\n\treturn Spec[T]{Name: strings.Join(names, \" AND \"), Test: func(c T) bool {\n\t\tfor _, s := range specs {\n\t\t\tif !s.Test(c) {\n\t\t\t\treturn false // short-circuit like &&\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}}\n}\n\nfunc Not[T any](s Spec[T]) Spec[T] {\n\treturn Spec[T]{Name: \"NOT (\" + s.Name + \")\", Test: func(c T) bool { return !s.Test(c) }}\n}\n\n// Unmet returns the names of the rules the candidate fails – handy for error messages.\nfunc Unmet[T any](c T, specs ...Spec[T]) []string {\n\tvar failed []string\n\tfor _, s := range specs {\n\t\tif !s.Test(c) {\n\t\t\tfailed = append(failed, s.Name)\n\t\t}\n\t}\n\treturn failed\n}\n\ntype Customer struct {\n\tVerified        bool\n\tTaxID           string\n\tOverdueInvoices int\n\tOrdersLastYear  int\n}\n\nvar (\n\tVerifiedCompany   = Spec[Customer]{\"verified company\", func(c Customer) bool { return c.Verified && c.TaxID != \"\" }}\n\tNoOverdueInvoices = Spec[Customer]{\"no overdue invoices\", func(c Customer) bool { return c.OverdueInvoices == 0 }}\n\tRegularBuyer      = Spec[Customer]{\"6+ orders last year\", func(c Customer) bool { return c.OrdersLastYear >= 6 }}\n\tTradeCreditPolicy = And(VerifiedCompany, NoOverdueInvoices, RegularBuyer)\n)"}]},{"type":"codeBlock","attrs":{"language":"python","filename":"specs.py"},"content":[{"type":"text","text":"from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Callable, Generic, TypeVar\n\nT = TypeVar(\"T\")\n\n\n@dataclass(frozen=True)\nclass Spec(Generic[T]):\n    \"\"\"A named business rule; &, | and ~ build new specifications.\"\"\"\n\n    name: str\n    test: Callable[[T], bool]\n\n    def is_satisfied_by(self, candidate: T) -> bool:\n        return self.test(candidate)\n\n    def __and__(self, other: Spec[T]) -> Spec[T]:\n        return Spec(f\"{self.name} AND {other.name}\", lambda c: self.test(c) and other.test(c))\n\n    def __or__(self, other: Spec[T]) -> Spec[T]:\n        return Spec(f\"{self.name} OR {other.name}\", lambda c: self.test(c) or other.test(c))\n\n    def __invert__(self) -> Spec[T]:\n        return Spec(f\"NOT ({self.name})\", lambda c: not self.test(c))\n\n\n@dataclass\nclass Customer:\n    verified: bool\n    tax_id: str | None\n    overdue_invoices: int\n    orders_last_year: int\n\n\nverified_company = Spec[Customer](\"verified company\", lambda c: c.verified and c.tax_id is not None)\nno_overdue_invoices = Spec[Customer](\"no overdue invoices\", lambda c: c.overdue_invoices == 0)\nregular_buyer = Spec[Customer](\"6+ orders last year\", lambda c: c.orders_last_year >= 6)\ntrade_credit_policy = verified_company & no_overdue_invoices & regular_buyer\n\n# Django ORM: Q and Exists are specifications the ORM translates to SQL.\n#   overdue = Invoice.objects.filter(customer=OuterRef(\"pk\"), paid=False, due_date__lt=today)\n#   audience = Customer.objects.filter(Q(verified=True, tax_id__isnull=False, orders_last_year__gte=6), ~Exists(overdue))"}]}]}]},"toc":[{"id":"the-problem-a-rule-scattered-across-the-code","text":"The problem: a rule scattered across the code","level":2,"locked":false},{"id":"the-solution-named-rules-and-combinators","text":"The solution: named rules and combinators","level":2,"locked":false},{"id":"implementation-in-five-languages","text":"Implementation in five languages","level":2,"locked":false},{"id":"step-by-step","text":"Step by step","level":2,"locked":true},{"id":"when-to-use-it-and-when-not","text":"When to use it and when not","level":2,"locked":true},{"id":"related-patterns","text":"Related patterns","level":2,"locked":true},{"id":"in-practice","text":"In practice","level":2,"locked":true},{"id":"check-yourself","text":"Check yourself","level":2,"locked":true},{"id":"practice-challenge","text":"Practice challenge","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":34,"visibleBlocks":14,"resources":[{"id":"6b0857b23c96f2d34d0b35a2","type":"repo","provider":"github","url":"https://github.com/ardalis/Specification","embedUrl":null,"title":"ardalis/Specification","description":"Base class with tests for adding specifications to a DDD model","author":"ardalis","thumbnailUrl":"https://opengraph.githubassets.com/1/ardalis/Specification","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["dotnet"],"tags":["ddd","design-patterns","domain-driven-design","dotnet","hacktoberfest","repository-pattern","testing","specification-pattern","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2018-02-13T16:42:06.000Z","popularity":65,"verifiedAt":"2026-11-26T10:58:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857be3c96f2d34d0b41dc","type":"article","provider":"web","url":"https://www.domainlanguage.com/ddd/reference","embedUrl":null,"title":"DDD Reference - Domain Language","description":"A summary of the patterns and definitions of DDD. This document is meant as a convenient reference for those who know the principles of Domain-Driven Design (DDD). It does not contain full explanations of DDD or even of the terms and patterns covered. It is intended to be used as a complement to…","author":"Domain Language (Eric Evans)","thumbnailUrl":"https://domainlanguage.com/wp-content/uploads/2016/04/71QA9u88PdL-194x300.jpg","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":80,"verifiedAt":"2026-11-26T11:26:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857c33c96f2d34d0b4669","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL4464385W","embedUrl":null,"title":"Domain-Driven Design","description":"","author":"Eric Evans","thumbnailUrl":"https://covers.openlibrary.org/b/id/5548424-L.jpg","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["book","software-architecture"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2003-01-01T00:00:00.000Z","popularity":61,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857be3c96f2d34d0b41f2","type":"article","provider":"web","url":"https://martinfowler.com/bliki/EvansClassification.html","embedUrl":null,"title":"bliki: Evans Classification","description":"a bliki entry for Evans Classification","author":"Martin Fowler","thumbnailUrl":"https://martinfowler.com/logo-sq.png","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["martin-fowler"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:07:28.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857b23c96f2d34d0b3463","type":"repo","provider":"github","url":"https://github.com/Sairyss/domain-driven-hexagon","embedUrl":null,"title":"Sairyss/domain-driven-hexagon","description":"Learn Domain-Driven Design, software architecture, design patterns, best practices. Code examples included","author":"Sairyss","thumbnailUrl":"https://opengraph.githubassets.com/1/Sairyss/domain-driven-hexagon","durationSec":null,"lang":"en","topics":["solid","clean-architecture","hexagonal-architecture","onion-architecture","ddd-strategic-design"],"techs":["node","javascript","typescript"],"tags":["architectural-patterns","architecture","backend","best-practices","clean-architecture","clean-code","design-patterns","software-architecture","system-design","ddd"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2020-11-29T16:04:22.000Z","popularity":81,"verifiedAt":"2026-11-26T10:58:46.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:49.541Z","updatedAt":"2026-11-26T16:00:49.541Z"}],"challenges":[{"id":"6b093dc091bd8fbaf2a0c8bc","slug":"catalog-specification","title":"Catalog specifications","summary":"Promotion rules as small objects combined with and, or and not – the Specification pattern from DDD, custom rules and catalog search.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"pattern","status":"published","difficulty":"medium","topics":["specification"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["specification","ddd","composite","business-rules","e-commerce"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":20,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:24.795Z"},{"id":"6b093ddebd4755deb67ee06e","slug":"flatten-object","title":"Flatten a nested object","summary":"Turn a nested JSON object into a flat path → value map (e.g. for a CSV export or a config diff). Recursion or an explicit stack, leaves and empty containers.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"algorithms","status":"published","difficulty":"easy","topics":["composite"],"techs":["typescript","javascript","python"],"tags":["recursion","objects","dfs","javascript"],"languages":["typescript","javascript","python"],"questionCount":null,"xp":10,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:54.109Z"},{"id":"6b0857af5a2625e44ecaad13","slug":"design-patterns-basics-quiz","title":"Design patterns – basics","summary":"Six questions about classic GoF patterns: groups, intent and differences.","servedLang":"en","availableLangs":["pl","en"],"kind":"quiz","category":null,"status":"published","difficulty":"easy","topics":["builder","adapter","strategy","decorator","composite","facade","observer"],"techs":["general"],"tags":["quiz","gof","basics"],"languages":[],"questionCount":6,"xp":10,"stats":{"attempts":1,"solves":1,"solutions":0,"comments":0},"solveRate":100,"publishedAt":"2026-11-26T16:00:47.960Z"}],"attachments":[],"hasCode":true,"repoUrl":null,"series":[],"prev":null,"next":null,"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Authority","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Authority","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Authority","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Authority","articles":38}]}}