Bold for Delphi is an Object Relational Mapper(ORM) and application framework. It's designed to significantly increase developer's productivity providing them with the following facilities:
- Object-relational mapping for persisting domain objects
- UML modeling of domain classes
- OCL as means of making queries (in-memory or to DB)
As in true model-driven environment model is a central part of an Bold application. The developer alters the model and the changes are applied automatically to the underlying implementation. This allows developers to concentrate on the problem domain model instead of drowning in the implementation specifics. In particular there is no need to take care of database design that makes Bold applications more object-oriented and less database-oriented. Model construction in Bold is done in visual Rational Rose 2003 UML editor. There is also a builtin editor that lack the UML diagrams. The corresponding code is generated on the fly in Delphi code.
Bold performs object-relational mapping based on metadata which is taken from the model (the bld-file). It implements such advanced object persistence features as caching, lazy load and others.
OCL is often referred to as an object analog for SQL. And indeed it is quite convenient to make OCL queries in terms of objects. For example the following expression gets company employees older than 30 years: "company.employees->select(age > 30)". Originally OCL was proposed by OMG as a means of describing constraints in UML models. But actually the usage area of OCL is much wider. In Bold OCL is used to express:
- Queries to the DB
- In-memory queries
- Evaluation expressions for derived class members
Bold uses its own OCL editor with syntax check and expression assistant. This makes writing OCL expressions in Bold easy and safe.
Derived members is a powerful feature in Bold.
- Divide complicated formulas in smaller pieces.
- Saves CPU-time as code is executed only when data changed.
A derived member can be of 3 main types:
- Attribut whose datatype is string, integer, float etc.
- Singlelink. It points to another instance in objectspace.
- Multilink. This holds a collection of instances in objectspace.
Derived members is used to calculate members result on the fly whenever the member is read. The implementation is done either in delphicode or in OCL. OCL is prefered but in some cases code is more flexible. If code is used then it must subscribe on dependent data. It can be ordinary members in the model or other derived members. Very complicated formulas can be built. The data to start from must of course be stored in a database but then this can be propagated through many derived members. The same can of course be achieved by ordinary functions but this require more CPU-time as code for a function is always executed. The code for a derived member is only executed when dependent data is changed. Else the cached value is returned.
22 September 2020 Embarcadero announced Bold as opensource https://blogs.embarcadero.com/bold-for-delphi-is-open-source/. Before that it was a long standing requests from users to do this as it was never developed after Delphi 7. The latest official version of Bold is for Delphi 2006.
There are some companies that bought the full source from Boldsoft before Borland bought it. One example is Attracs.
https://github.com/Embarcadero/BoldForDelphi Original source of Bold. Not compatible with Unicode and missing file BoldRegularExpression.pas due to a copyright problem.
https://github.com/Embarcadero/BoldForDelphi/tree/AttracsBold Source compatible with unicode and latest Delphi