Get your first Bold application running in 15 minutes! ⏱️
Bold for Delphi is a Model-Driven Architecture (MDA) framework that:
- Lets you define your domain model in UML
- Auto-generates strongly-typed Delphi classes from your model
- Handles object-relational mapping (ORM) to any database
- Provides OCL (Object Constraint Language) for queries
- Includes data-aware VCL components with automatic UI updates
The core idea: You work with objects, Bold handles the database.
UML Model → Code Generator → Business Classes → Bold Runtime → Database
- Delphi 11.3, 12.1 CE, 12.3, or 13
- Database: The following FireDAC-supported databases should work. SQLite, SQL Server, PostgreSQL, Firebird, MariaDB/MySQL and Oracle. SQLite requires no installation.
- Bold packages installed (see Installation below)
git clone https://github.com/bero/BoldForDelphi.git
Or download and extract to a folder like C:\BoldForDelphi.
Option A: Download Pre-built Binaries (Recommended)
Download the binary package for your Delphi version from: https://github.com/bero/BoldForDelphi/releases/
Extract to packages\Bin\.
Add the new package from menu Component/Install packages...
Then press Add and select your bpl-file
Option B: Build from Source 🔧
Compiling from source gives you the latest version, or lets you use Bold with unsupported Delphi versions.
Open the package project for your Delphi version in the IDE:
| Delphi Version | Open this file |
|---|---|
| Delphi 11.3 Alexandria | packages\Delphi11.3\dclBold.dproj |
| Delphi 12.1 CE Athens | packages\Delphi12.1_CE\dclBold.dproj |
| Delphi 12.3 Athens | packages\Delphi12.3\dclBold.dproj |
| Delphi 13 Athens | packages\Delphi13\dclBold.dproj |
Then:
- File → Open Project and select the
.dprojfrom the table above - Project → Build (or Shift+F9) to compile the package
- In the Project Manager panel, right-click the
.bpland choose Install - Verify via menu Component → Install Packages... — you should see "Bold for Delphi" in the list
The compiled BPL is output to packages\Bin\.
You should now see Bold components in the Tool Palette. 🎉
Using an unsupported Delphi version:
If your Delphi version is not listed above:
- Copy the folder of the closest supported version (e.g., copy
Delphi13for Delphi 14) - Rename the folder to match your Delphi version (e.g.,
Delphi14) - Open
dclBold.dprojin the IDE - Go to Project → Options → Description and update the Lib Suffix to match your compiler version
- Build and install as described above
- If it works, consider submitting a pull request to include the new package folder
First option is to look at a ready-made small app:
examples\Simple\ObjectSpace\MasterDetail\MasterDetail.dproj
Important: This example uses design-time Bold components, so you must install the Bold package first (Step 2 above). Then open and compile MasterDetail. It defaults to SQLite — no database server needed, just press F9.
Second option is to build app from scratch. More fun and more learning 😊 We'll build a simple app with Person and Building objects, where persons can own buildings.
- File → New → VCL Forms Application
- Save the project (e.g.
Building.dproj)
- File → New → Other → Delphi Files → Data Module
- Save as
DataModule1.pas
Drop these components on your DataModule from the Bold palette:
| Component | Purpose |
|---|---|
TBoldModel |
Holds your UML model |
TBoldSystemHandle |
Main runtime system |
TBoldSystemTypeInfoHandle |
Type information for design-time |
TBoldPersistenceHandleDB |
Database persistence |
Connect them:
BoldSystemHandle1.BoldModel→BoldModel1BoldSystemHandle1.PersistenceHandle→BoldPersistenceHandleDB1BoldSystemTypeInfoHandle1.BoldModel→BoldModel1
-
Drop a
TFDConnection(FireDAC) on the DataModule -
Configure it for your database. SQLite is the easiest to start with — no server needed:
[Database] Persistence=FireDAC Type=SQLite [SQLite] Database=BoldDemo.db
The database file is created automatically on first run.
Other database configurations (SQL Server, PostgreSQL, Firebird, MariaDB, Oracle)
For SQL Server:
[Database] Persistence=FireDAC Type=MSSQL [MSSQL] Server=localhost Database=BoldDemo OSAuthent=True User=sa Password=
For PostgreSQL:
[Database] Persistence=FireDAC Type=PostgreSQL [PostgreSQL] Server=localhost Database=bolddemo VendorLib=C:\Program Files\PostgreSQL\18\bin\libpq.dll User=postgres Password=<your_password>
For Firebird:
[Database] Persistence=FireDAC Type=Firebird [Firebird] Server=localhost Database=C:\Data\BoldDemo.fdb VendorLib=C:\Program Files\Firebird\Firebird_5_0\fbclient.dll User=SYSDBA Password=<your_password>
For MariaDB (or MySQL):
[Database] Persistence=FireDAC Type=MariaDB [MariaDB] Server=localhost Port=3306 Database=bolddemo User=root Password=<your_password> VendorLib=C:\Program Files\MariaDB\MariaDB Connector C 64-bit\lib\libmariadb.dll
Note: MariaDB requires the MariaDB Connector/C client library. Download from https://mariadb.com/downloads/connectors/ (Connector/C, Windows 64-bit). For MySQL, point VendorLib to
libmysql.dllinstead.For Oracle:
[Database] Persistence=FireDAC Type=Oracle [Oracle] Database=//localhost:1521/XEPDB1 User=bolduser Password=<your_password> VendorLib=C:\oracle\instantclient_23_7\oci.dll
Note: Oracle requires the Oracle Instant Client. The
Databaseparameter uses Easy Connect format://host:port/service_name. -
Drop a
TBoldDatabaseAdapterFireDACcomponent -
Set
BoldDatabaseAdapterFireDAC1.Connection→FDConnection1 -
Set
BoldPersistenceHandleDB1.DatabaseAdapter→BoldDatabaseAdapterFireDAC1
- Double-click
BoldModel1to open the Model Editor - Create your classes:
Person class:
- Right-click → Add Class → Name:
Person - Add attributes:
FirstName: StringLastName: StringAssets: Currency
Building class:
- Add Class → Name:
Building - Add attributes:
Address: StringZipCode: Integer
Create an association (Ownership):
- Select both classes
- Right-click → Add Association
- Name:
Ownership - Person side:
OwnedBuildings(0..*) - Building side:
Owners(0..*)
- File → Save & Generate all files
This creates BusinessClasses.pas with strongly-typed classes.
- Add the generated
BusinessClasses.pasto your project - Add to DataModule uses clause:
uses BusinessClasses;
On your main form, add:
List Handles (from Bold Handles palette):
-
TBoldListHandlenamedblhAllPersonsRootHandle→DataModule1.BoldSystemHandle1Expression→Person.allInstances
-
TBoldListHandlenamedblhAllBuildingsRootHandle→DataModule1.BoldSystemHandle1Expression→Building.allInstances
GUI Components (from Bold Controls palette):
TBoldGridfor persons →BoldHandle=blhAllPersonsTBoldGridfor buildings →BoldHandle=blhAllBuildingsTBoldNavigator→BoldHandle=blhAllPersons
Actions (from Bold Actions palette):
TBoldActivateSystemAction→ Opens the databaseTBoldUpdateDBAction→ Saves changes to database- Add buttons linked to these actions
In your main form's OnCreate:
procedure TForm1.FormCreate(Sender: TObject);
begin
// Activate opens/creates the database and loads the model
BoldActivateSystemAction1.Execute;
end;- Press F9 to run
- Click "Open System" to activate
- Use the navigator to add Person records
- The grid automatically displays them
- Click "Update DB" to save
That's it! You have a working Bold application. ✅
Bold generates clean, strongly-typed classes. Here's how to use them:
var
Person: TPerson;
Building: TBuilding;
begin
// Create objects - Bold tracks them automatically
Person := TPerson.Create(BoldSystemHandle1.System);
Person.FirstName := 'John';
Person.LastName := 'Doe';
Person.Assets := 50000;
Building := TBuilding.Create(BoldSystemHandle1.System);
Building.Address := '123 Main Street';
Building.ZipCode := 12345;
// Create relationship
Person.OwnedBuildings.Add(Building);
end;var
RichPeople: TBoldObjectList;
begin
// Find all persons with assets > 100000
RichPeople := BoldSystemHandle1.System.EvaluateExpressionAsNewElement(
'Person.allInstances->select(assets > 100000)'
) as TBoldObjectList;
// Use type-safe access
for var i := 0 to RichPeople.Count - 1 do
ShowMessage(TPerson(RichPeople[i]).FirstName);
end;// Save all changes
BoldSystemHandle1.UpdateDatabase;
// Or discard changes
BoldSystemHandle1.System.Discard;| Concept | Description |
|---|---|
| BoldSystem | The runtime container for all your objects |
| Handles | Connect UI components to objects (TBoldListHandle, TBoldExpressionHandle) |
| OCL Expressions | Query language: Person.allInstances->select(age > 30) |
| Subscription | UI auto-updates when objects change |
| M_ properties | Direct access to Bold members: Person.M_FirstName.AsString |
Person.allInstances -- All persons
Person.allInstances->size -- Count of persons
Person.allInstances->select(assets > 0) -- Filter
Person.allInstances->collect(lastName) -- Extract attribute
Person.allInstances->sortedBy(lastName) -- Sort
self.ownedBuildings->size -- Count related objects
self.firstName + ' ' + self.lastName -- Concatenation
- Explore the Examples: See
examples/Compound/Building/for a more complex sample (note: this is a legacy Delphi 7 project — use it as a code reference, not as a compilable project) - Read the Tutorials: Check
Doc/Starting Bfd - Part 1, 2, 3.pdf - Learn OCL: See
Doc/ad970808_UML11_OCL.pdffor the OCL specification - Try Derived Attributes: Computed values that auto-update
- Add Constraints: Validate your model with OCL constraints
"Bold.inc not found"
- Add
Source\Common\Includeto your project's search path
Components not showing in palette
- Verify the BPL is installed (Component → Install Packages)
- Check that all dependent packages are loaded in menu Component/Install packages...
Database errors on first run
- Use
TBoldCreateDatabaseActionto create the schema first - Or call
BoldPersistenceHandleDB1.CreateDataBaseSchema
PostgreSQL: "libpq.dll not found" or connection fails
- Copy
libpq.dlland its dependencies to your executable folder (see Step 4) - The DLLs are in your PostgreSQL installation's
binfolder
Firebird: "fbclient.dll not found" or connection fails
- Copy
fbclient.dllto your executable folder (see Step 4) - The DLL is in your Firebird installation folder
MariaDB/MySQL: "libmysql.dll not found" or connection fails
- MariaDB Server does not include the client library - you need MariaDB Connector/C
- Download from https://mariadb.com/downloads/connectors/ (Connector/C, Windows 64-bit)
- Set VendorLib in your INI to point to
libmariadb.dll - For MySQL, point VendorLib to
libmysql.dllin your MySQL installation
Oracle: "oci.dll not found" or connection fails
- Download Oracle Instant Client from https://www.oracle.com/database/technologies/instant-client/downloads.html
- Extract to a folder (e.g.,
C:\oracle\instantclient_23_7) - Set VendorLib in your INI to point to
oci.dllin that folder - The Database parameter uses Easy Connect format:
//host:port/service_name
Oracle: ORA-01400 "cannot insert NULL" errors
- This can occur if your database schema was created with an older Bold version
- Use the "Reset Oracle Schema" option in the demo app to recreate tables
- Or manually drop all tables and let Bold recreate them
SQLite: Database file not created
- SQLite creates the database file automatically on first connection
- Check that the path in the INI file is writable
- The file will be created in the same folder as the executable if no path is specified
- Git Embarcadero original repo: https://github.com/Embarcadero/BoldForDelphi
- Git active development: https://github.com/bero/BoldForDelphi/tree/develop
- Wiki: https://delphi.fandom.com/wiki/Bold_for_Delphi
- Discord: https://discord.gg/C6frzsn
- Blog: http://boldfordelphi.blogspot.com/
Bold for Delphi - Model-Driven Development for Delphi since 2004