Building Production-Grade Delphi Applications from Beginner to Expert
Introduction
- What You Will Learn
- How This Book Is Organized
- Prerequisites
- Code Examples
- Conventions Used
- A Note on Versions
- Getting Help
Chapter 1: Getting Started with DMVCFramework
- What Is DMVCFramework and Why It Exists
- Installing the Framework: Package Manager, Git, and Manual Methods
- Your First Project: From Empty Form to Running Server
- Understanding the Default Project Structure
- How DMVCFramework Fits into the Delphi Ecosystem
- Summary
Chapter 2: MVC Architecture Fundamentals in DMVCFramework
- The Model-View-Controller Pattern: Origins and Intent
- Controllers: Request Handling, Actions, and Lifecycle
- Views: Rendering Responses, Templates, and Formats
- Models: Data Representation and Business Logic Separation
- How a Request Flows Through the Framework
- Summary
Chapter 3: Routing and URL Design
- Basic Route Configuration and Conventions
- Route Parameters and Dynamic Segments
- HTTP Method Routing and RESTful Design
- Advanced Routing: Constraints, Groups, and Prefixes
- API Versioning Strategies with Routing
- Summary
Chapter 4: Controllers in Depth
- Controller Classes, Naming Conventions, and Registration
- Action Methods: Signatures, Attributes, and Return Types
- Request Data Access: Parameters, Headers, Body Parsing
- Filters: Before, After, and Around Execution
- Thin Controllers: Delegating to Services
- Summary
Chapter 5: Views and Response Handling
- Response Types: JSON, XML, HTML, and Binary
- Template Engines: Mustache, Handlebars, and Custom Templates
- Content Negotiation and Accept Headers
- Serialization and Deserialization with DMVCFramework
- Streaming Responses and Large Payloads
- Summary
Chapter 6: Models, Services, and Repositories
- Domain Models vs DTOs vs Entity Classes
- The Repository Pattern: Abstraction Over Data Access
- Service Layer Design and Business Logic Placement
- Dependency Injection with TInjector
- Building a Layered Architecture
- Summary
Chapter 7: Database Integration and ORM Patterns
- Connecting to Databases with FireDAC and Alternatives
- Structuring Data Access: Repositories and Mappers
- Transaction Management and Concurrency Patterns
- Building a Generic Repository Base Class
- Database Migration Strategies
- Summary
Chapter 8: Authentication, Authorization, and Security
- Authentication Mechanisms: Sessions, JWT, and API Keys
- Implementing Role-Based Access Control (RBAC)
- Input Validation and Sanitization Patterns
- CORS Configuration and Cross-Origin Security
- Security Hardening: HTTPS, Headers, and Common Vulnerabilities
- Summary
Chapter 9: Middleware, Error Handling, and Logging
- The Middleware Pipeline: Concept and Configuration
- Building Custom Middleware Components
- Centralized Error Handling and Exception Filters
- Structured Logging with Multiple Providers
- Health Checks and Readiness Probes
- Summary
Chapter 10: File Operations, Uploads, and Downloads
- Handling File Uploads and Multipart Requests
- Serving Static Files and Assets
- Streaming File Downloads with Proper Headers
- Security Considerations for File Operations
- Integrating Cloud Storage: S3 and Azure Blob
- Summary
Chapter 11: Background Processing and Async Patterns
- Thread Management in Delphi Web Applications
- Background Jobs and Task Queues
- Scheduled Tasks and Cron-Like Scheduling
- Integrating Message Brokers: RabbitMQ and Redis
- Async/Await Patterns with Modern Delphi
- Summary
Chapter 12: Caching, Performance, and Optimization
- In-Memory Caching Strategies and Implementations
- Distributed Caching with Redis
- Database Query Optimization and Indexing
- Connection Pooling and Resource Management
- Profiling, Benchmarking, and Performance Tuning
- Summary
Chapter 13: Testing DMVCFramework Applications
- Unit Testing Controllers, Services, and Repositories
- Mocking Dependencies with TInjector
- Integration Testing with Real Database Connections
- End-to-End API Testing Strategies
- Continuous Integration Setup for Delphi Projects
- Summary
Chapter 14: Deployment and Production Operations
- Build Configuration and Environment-Specific Settings
- Deploying to Linux, Windows Servers, and Containers
- Docker and Kubernetes for DMVCFramework Applications
- Monitoring, Alerting, and Observability in Production
- Scaling Strategies: Horizontal, Vertical, and Microservices
- Summary
Chapter 15: Advanced Patterns and Real-World Architecture
- Clean Architecture and Hexagonal Design in DMVCFramework
- Event-Driven Patterns and Domain Events
- Microservice Communication and API Gateway
- Building a Production-Grade Application: Complete Example
- Framework Limitations and When to Extend or Replace
- Summary