Skip to content

Commit 8291267

Browse files
committed
Docs WIP: Add more TOC.
1 parent a10a7e5 commit 8291267

File tree

17 files changed

+207
-3
lines changed

17 files changed

+207
-3
lines changed

docs/advanced/caching.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
Holloway's entity caching system is a critical performance optimization that implements the Identity Map pattern. It ensures that each database record creates only one entity instance per request, provides dirty tracking for efficient updates, and eliminates redundant entity creation.
44

5+
## Table of Contents
6+
7+
- [How Entity Caching Works](#how-entity-caching-works)
8+
- [Entity Cache Architecture](#entity-cache-architecture)
9+
- [Cache Benefits](#cache-benefits)
10+
- [Cache Management](#cache-management)
11+
- [Cache Configuration](#cache-configuration)
12+
- [Performance Characteristics](#performance-characteristics)
13+
- [Cache in Relationships](#cache-in-relationships)
14+
- [Cache Debugging](#cache-debugging)
15+
- [Best Practices](#best-practices)
16+
- [Cache Limitations and Considerations](#cache-limitations-and-considerations)
17+
- [Next Steps](#next-steps)
18+
519
## How Entity Caching Works
620

721
### The Identity Map Pattern

docs/api/reference.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
Complete reference documentation for Holloway's core classes and interfaces. This reference covers all public methods, properties, and configuration options.
44

5+
## Table of Contents
6+
7+
- [Core Classes](#core-classes)
8+
- [Configuration Options](#configuration-options)
9+
- [Events](#events)
10+
- [Exceptions](#exceptions)
11+
- [Constants](#constants)
12+
- [Next Steps](#next-steps)
13+
514
## Core Classes
615

716
### Mapper

docs/architecture.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
# Architecture Overview
22

3-
This document explains how Holloway works under the hood: the design patterns, lifecycle hooks, and infrastructure that power the data mapper. You do **not** need any of this to ship your first feature—treat it as the engineering manual once youre comfortable with the basics.
3+
This document explains how Holloway works under the hood: the design patterns, lifecycle hooks, and infrastructure that power the data mapper. You do **not** need any of this to ship your first feature—treat it as the engineering manual once you're comfortable with the basics.
44

55
> **Audience:** framework contributors, senior engineers integrating Holloway deeply, or anyone debugging advanced scenarios.
6-
> **Prerequisites:** you’ve completed the [Getting Started](./getting-started.md) tutorial and shipped at least one mapper in your application.
6+
> **Prerequisites:** you've completed the [Getting Started](./getting-started.md) tutorial and shipped at least one mapper in your application.
7+
8+
## Table of Contents
9+
10+
- [Before you dive in](#before-you-dive-in)
11+
- [The Datamapper Pattern](#the-datamapper-pattern)
12+
- [Core Components](#core-components)
13+
- [Data Flow](#data-flow)
14+
- [Advanced Architecture Features](#advanced-architecture-features)
15+
- [Performance Considerations](#performance-considerations)
16+
- [Laravel Integration Points](#laravel-integration-points)
17+
- [Design Patterns Used](#design-patterns-used)
18+
- [Next Steps](#next-steps)
719

820
## Before you dive in
921

docs/core-concepts/base-classes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ This guide documents a reference implementation of base `Entity` and `Mapper` cl
44

55
> **Note**: This is ONE approach to implementing Holloway entities and mappers. Holloway is flexible and doesn't require these patterns, but they represent a battle-tested approach used in a production multi-tenant SaaS application.
66
7+
## Table of Contents
8+
9+
- [Overview](#overview)
10+
- [Base Entity Class](#base-entity-class)
11+
- [Base Mapper Class](#base-mapper-class)
12+
- [Entity Traits](#entity-traits)
13+
- [Example Child Mapper](#example-child-mapper)
14+
- [Example Child Entity](#example-child-entity)
15+
- [Integration Example](#integration-example)
16+
- [When to Use These Base Classes](#when-to-use-these-base-classes)
17+
- [Next Steps](#next-steps)
18+
719
## Overview
820

921
This reference implementation extends Holloway's base classes to provide:

docs/core-concepts/entity-hydration.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
Entity hydration is the process of converting database records (raw data) into domain entity instances. This is one of the core responsibilities of the datamapper pattern, and Holloway gives you complete control over how this process works.
44

5+
## Table of Contents
6+
7+
- [Understanding the Core Contract](#understanding-the-core-contract)
8+
- [The Challenge](#the-challenge)
9+
- [Approach 1: Simple Manual Hydration](#approach-1-simple-manual-hydration)
10+
- [Approach 2: Magic Accessor Pattern (Recommended for PHP 8.0-8.3)](#approach-2-magic-accessor-pattern-recommended-for-php-80-83)
11+
- [Approach 3: Named Constructors](#approach-3-named-constructors)
12+
- [Approach 4: Reflection-Based](#approach-4-reflection-based)
13+
- [Comparison Table](#comparison-table)
14+
- [Recommendations](#recommendations)
15+
- [Key Principles](#key-principles)
16+
- [Next Steps](#next-steps)
17+
- [Further Reading](#further-reading)
18+
519
## Understanding the Core Contract
620

721
At its heart, Holloway requires mappers to implement two critical methods:

docs/core-concepts/entity-lifecycle.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ One of the most important concepts in the datamapper pattern is understanding th
77

88
Understanding this distinction is critical for proper validation, initialization, and domain logic placement.
99

10+
## Table of Contents
11+
12+
- [The Two Lifecycles](#the-two-lifecycles)
13+
- [Why Separate These?](#why-separate-these)
14+
- [Implementation Patterns](#implementation-patterns)
15+
- [Real-World Example](#real-world-example)
16+
- [Validation Placement](#validation-placement)
17+
- [Common Pitfalls](#common-pitfalls)
18+
- [Decision Matrix](#decision-matrix)
19+
- [Key Principles](#key-principles)
20+
- [Next Steps](#next-steps)
21+
- [Further Reading](#further-reading)
22+
1023
## The Two Lifecycles
1124

1225
### Creation Lifecycle

docs/examples/best-practices.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
This guide covers advanced patterns, performance optimizations, and proven techniques for building robust applications with Holloway's datamapper architecture.
44

5+
## Table of Contents
6+
7+
- [Architecture Best Practices](#architecture-best-practices)
8+
- [Performance Optimization](#performance-optimization)
9+
- [Error Handling](#error-handling)
10+
- [Testing Strategies](#testing-strategies)
11+
- [Security Best Practices](#security-best-practices)
12+
- [Monitoring and Debugging](#monitoring-and-debugging)
13+
- [Code Organization](#code-organization)
14+
- [Performance Benchmarking](#performance-benchmarking)
15+
- [Production Deployment](#production-deployment)
16+
- [Next Steps](#next-steps)
17+
518
## Architecture Best Practices
619

720
### Entity Design

docs/examples/complete-examples.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
This guide provides comprehensive, real-world examples of Holloway datamapper implementations. Each example demonstrates best practices, proper architecture, and practical patterns you can adapt for your own projects.
44

5+
## Table of Contents
6+
7+
- [Example 1: Blog Management System](#example-1-blog-management-system)
8+
- [Example 2: E-commerce Order Management](#example-2-e-commerce-order-management)
9+
- [Next Steps](#next-steps)
10+
511
## Example 1: Blog Management System
612

713
A complete blog system with users, posts, comments, and categories.

docs/getting-started.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
This quick tour shows how to install Holloway in a fresh Laravel project, register your first mapper, and perform real CRUD using rich domain entities. Follow the steps in order—each one builds on the last.
44

5+
## Table of Contents
6+
7+
- [Prerequisites](#prerequisites)
8+
- [1. Install the package](#1-install-the-package)
9+
- [2. Create a Holloway service provider](#2-create-a-holloway-service-provider)
10+
- [3. Add base classes for entities and mappers](#3-add-base-classes-for-entities-and-mappers)
11+
- [4. Build your first entity and mapper](#4-build-your-first-entity-and-mapper)
12+
- [5. Wire it into Laravel](#5-wire-it-into-laravel)
13+
- [6. Smoke-test the setup](#6-smoke-test-the-setup)
14+
- [Laravel integration tips](#laravel-integration-tips)
15+
- [Troubleshooting](#troubleshooting)
16+
- [Where next?](#where-next)
17+
518
## Prerequisites
619

720
- Laravel 10 or 11 project with a working database connection.

docs/laravel/service-provider.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
Holloway includes a Laravel service provider that handles integration with Laravel's service container and database connections.
44

5+
## Table of Contents
6+
7+
- [What the Service Provider Does](#what-the-service-provider-does)
8+
- [Registration](#registration)
9+
- [Database Integration](#database-integration)
10+
- [Event Integration](#event-integration)
11+
- [Extending the Service Provider](#extending-the-service-provider)
12+
- [Next Steps](#next-steps)
13+
514
## What the Service Provider Does
615

716
The `HollowayServiceProvider` performs two key functions:

0 commit comments

Comments
 (0)