ACBr Project Patterns

Decouple Delphi ACBr projects from VCL components using dependency injection and wrapper services.

48|12|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/delphicleancode/delphi-spec-kit --skill acbr-project-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ACBr Project Patterns
Source: https://github.com/delphicleancode/delphi-spec-kit/tree/main/.gemini/skills/acbr-components
Command: npx skills add https://github.com/delphicleancode/delphi-spec-kit --skill acbr-project-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Architectural, dependency injection and UI patterns for the ACBr Project (Commercial Automation Brazil) ecosystem in Delphi.

Core Features & Use Cases

  • Avoid strong visual coupling: Do not instantiate ACBr UI components directly in the View forms. Use Service "Wrapper" classes or Infrastructure Repositories that inject the system configurations to the fiscal engine.
  • Abstract signing & cryptography libraries: Isolate libraries (OpenSSL vs WinCrypt) and switch them via code, not by design-time wiring.
  • Handle callbacks and events: Define a generic UI Handler interface injected into business logic to decouple event handling.
  • Dynamic memory management: Ensure proper lifetime management of sub-function components to prevent leaks.
  • Component prefixes: Use mapping like acbrNfe, acbrNfce, etc., to standardize naming across modules.

Quick Start

Refactor a legacy ACBr module to use wrapper services and DI-based configurations instead of direct ACBr component instantiation.

Frequently Asked Questions about ACBr Project Patterns

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

FAQPage Schema
How do I decouple ACBr components from VCL forms in Delphi?

To decouple ACBr components from VCL views, use Service Wrapper classes or Infrastructure Repositories that inject system configurations into the fiscal engine instead of instantiating ACBr UI components directly within forms.

What is the best way to switch signing libraries in ACBr without design-time wiring?

The best way to switch signing libraries in ACBr is to abstract cryptography libraries like OpenSSL and WinCrypt, isolating them so you can toggle them via code rather than relying on design-time wiring.

How does dependency injection handle ACBr events and callbacks in Delphi?

Dependency injection handles ACBr events by defining a generic UI Handler interface that gets injected directly into business logic, effectively decoupling event handling from visual components.

Can I standardize ACBr component naming across multiple Delphi modules?

Yes, you can standardize ACBr component naming across Delphi modules by applying consistent component prefixes like acbrNfe and acbrNfce to ensure uniform naming conventions throughout the project.

Why do my ACBr sub-function components cause memory leaks in Delphi?

ACBr sub-function components cause memory leaks due to improper lifetime management. Applying DI-friendly patterns ensures dynamic memory management and proper lifetime control to prevent these leaks.

Does refactoring legacy ACBr projects require direct dependency injection frameworks?

Refactoring legacy ACBr projects does not strictly require external DI frameworks but focuses on using wrapper services and DI-based configurations to replace direct ACBr component instantiation for clean architecture.