> For the complete documentation index, see [llms.txt](https://build-it-the-right-way.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://build-it-the-right-way.gitbook.io/home/design-patterns/servicenow-architecture-pattern-library.md).

# Pattern Library Overview

Watch the Overview

{% embed url="<https://youtu.be/-RaBBIDiwgY>" %}

In this video, I walk through the full pattern library and explain how each pattern maps to the Build It the Right Way architecture framework.

#### Pattern Summary Table

| Pattern Name                  | Intent                                                            | Pillars                                                     | Example Use Cases                              |
| ----------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------- | ---------------------------------------------- |
| Listener-Validator-Handler    | Separate request processing into listener, validator, and handler | Security, Observability, Separation of Concerns, Modularity | REST APIs, Webhooks, Queues                    |
| Scoped Utility Layer          | Centralize reusable logic within scoped apps                      | Modularity, Upgrade-Safe Architecture, Reusability          | Logging, Token Generation                      |
| Anti-Corruption Layer         | Transform/clean legacy data before processing                     | Security, Business Alignment, Separation of Concerns        | Legacy integrations, CMDB Imports              |
| Event-to-Flow                 | Trigger flows via business events                                 | Observability, Scalability, Modularity                      | Change approvals, Notifications                |
| External Orchestration        | Orchestrate logic externally with ServiceNow as a target          | Scalability, Governance, Security                           | Mulesoft/Logic Apps calling SN                 |
| Process-Driven CMDB           | Align CMDB with service/business logic                            | Business Alignment, Observability, Governance               | GRC, Impact Analysis                           |
| Domain Gateway                | Route logic based on domain/customer context                      | Security, Governance, Separation of Concerns                | MSP, Domain-separated instances                |
| Factory Pattern               | Dynamically instantiate handlers based on input                   | Modularity, Reusability, Separation of Concerns             | Dynamic handlers, Routers                      |
| BaseLogger Pattern            | Centralized and consistent logging                                | Observability, Auditability, Modularity                     | Monitoring, Debugging                          |
| Repository Pattern            | Abstract data access logic                                        | Separation of Concerns, Reusability, Maintainability        | CRUD logic for core tables                     |
| Token Validation Layer        | Enforce token/API key validation                                  | Security, Observability                                     | Secure API entry points                        |
| Service-Aware Catalog Pattern | Map catalog logic to services                                     | Business Alignment, Governance, Observability               | SLA routing, Fulfillment logic                 |
| App Configuration Registry    | Store business rules as config data                               | Upgrade-Safe, Governance, Flexibility                       | Feature toggles, Config switches               |
| Integration Throttle Pattern  | Protect instance from overload via throttling                     | Scalability, Security, Observability                        | Rate-limiting, Queue management                |
| Service Wrapper Pattern       | Encapsulate logic inside reusable service methods                 | Modularity, Upgrade-Safe Architecture, Governance           | Common services (e.g., createTask, notifyUser) |
