FreePascal/Lazarus SOLID Patterns

Implement SOLID design patterns for FreePascal/Lazarus projects.

17|7|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/delphicleancode/lazarus-spec-kit --skill freepascal-lazarus-solid-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: FreePascal/Lazarus SOLID Patterns
Source: https://github.com/delphicleancode/lazarus-spec-kit/tree/main/.gemini/skills/lazarus-patterns
Command: npx skills add https://github.com/delphicleancode/lazarus-spec-kit --skill freepascal-lazarus-solid-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured approach to building SOLID-compliant FreePascal/Lazarus applications, reducing coupling and code smells, while promoting testable, maintainable architectures.

Core Features & Use Cases

  • Repository pattern interfaces and concrete implementations for data access.
  • Service layer with constructor injection to orchestrate business logic.
  • Factory pattern for assembling repositories and services.
  • Strategy pattern for interchangeable algorithms (e.g., tax calculations).
  • Guidance aligned with SOLID, DDD, and clean architecture for scalable Lazarus projects.

Quick Start

Define your domain entity, create repository interfaces, implement the repository and service with constructor injection, and wire them together with the factory.

Frequently Asked Questions about FreePascal/Lazarus SOLID Patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement SOLID design patterns in FreePascal/Lazarus applications?

Implement SOLID design patterns in FreePascal/Lazarus by using guided templates for repository, factory, and strategy patterns with constructor injection. This standardizes development and promotes clean, modular code across domain entities and application layers.

What's the best way to structure a clean architecture domain layer in Lazarus?

Structure a clean architecture domain layer in Lazarus by defining domain entities, creating repository interfaces, and orchestrating business logic through a service layer. This approach reduces coupling and promotes testable, maintainable architectures.

How do I use constructor injection for service layers in FreePascal?

Use constructor injection for service layers in FreePascal by passing repository interfaces directly into service constructors. This encapsulates dependency management, standardizes wiring, and ensures business logic remains decoupled from data access implementations.

Does this SOLID patterns approach support interchangeable algorithms like tax calculations?

The SOLID patterns approach supports interchangeable algorithms like tax calculations through the strategy pattern. This allows you to swap computational logic dynamically without modifying the core service structure.

Can I use the repository pattern for data access in FreePascal without heavy dependencies?

You can use the repository pattern for data access in FreePascal without heavy dependencies by defining repository interfaces and lightweight concrete implementations. This abstracts data access, reducing code smells and coupling.

When should I use the factory pattern to assemble repositories and services in Lazarus?

Use the factory pattern to assemble repositories and services in Lazarus when you need centralized wiring of application layers. Factories construct and inject dependencies, ensuring consistent initialization of domain entities and services.