tiOPF

From Free Pascal wiki
Jump to navigationJump to search

About

The TechInsite Object Persistence Framework (tiOPF) is an Open Source framework of Delphi/Object Pascal code that simplifies the mapping of an object oriented business model into a relational database. The framework is mature and robust. It has been in use on production sites for over seven years. It is free, open source, and available for immediate download with full source code.

Some of the key features of the tiOPF include:

  • Lets you build an object oriented application that can swap databases with the flick of a command like a command line parameter or a change of a compiler directive. Currently, there are persistence layers for Interbase-IBX, Oracle-DOA, XML-MSDOM, XML-XMLLite, Paradox-BDE, MSAccess-ADO, MSSQLServer-ADO, FireBird-FBLib, FireBird-SqlDB, HTTP Proxy-Remote, CSV files and TAB files.
  • Family of abstract base classes for building a complex object model
  • 27 Persistent object aware components for building complex GUIs (Delphi only).
  • Model-GUI-Mediators for enabling any standard GUI component to become Object Aware.
  • 1400+ DUnit/fpcUnit tests to guarantee stability
  • 160 pages of documentation to get you started
  • News groups for support
  • Automated, daily builds and unit testing
  • Lots of demos focusing on specific parts of the framework for easy learning.
  • Cross platform. Currently tested on Windows and Linux.

Authors

Peter Hinrichsen - Original Designer.
Graeme Geldenhuys - Ported to Free Pascal.

License

Mozilla Public License (please contact the author if the MPL doesn't work with your project licensing)

Download

The latest stable release can be found on the TechInsite page.
The latest development code can be found on the SubVersion server as follows

svn co http://tiopf.techinsite.com.au/svn/tiOPF2/Trunk tiOPF2

or downloaded as a nightly build zip file from the DailyBuild page.

Dependencies / System Requirements

  • Compiler: Free Pascal 2.0.2
  • Components for your required persistence layer, if it is not included with the compiler. eg: FBLib for FireBird RDMS.

Status: Stable (Tested on Windows and Linux.)

Issues: None

Installation

  • Unzip the zip file to a location of your choice.
  • Open Lazarus
  • Open the package tiOPF.lpk with Component/Open package file (.lpk) located in the Source\Compilers\FPC directory.
  • Click on Compile

NOTE
Also execute the following from the \Core directory. tiDefines.inc is included in every unit, but normally only exists in \Core. This works fine under Delphi, but Free Pascal complains and says it can't find it for every unit outside \Core. I am still trying to figure out how to solve this under Lazarus.

copy tiDefines.inc ..\Options
copy tiDefines.inc ..\GUI
copy tiDefines.inc ..\UnitTests\Common
copy tiDefines.inc ..\UnitTests\Tests

Another thing. I included the FBLib components as the default persistence layer for FPC in the tiOPF.lpk package. That is the only one I use under FPC/Lazarus. So make sure you have FBLib installed, or you need to remove it from the tiOPF package.

Persistence layers are controlled by a Compiler Directive under Compiler Options -> Other -> Custom Options. eg: LINK_FBL = FBLib components. For more all the available options see the end of the tiOPFManager.pas unit.

Usage

In Lazarus, open your project and add tiOPF as a Required Package (Project -> Project Inspector -> Add). Include tiObject in your uses clause. You are now read to create object decending from TtiObject or TtiObjectList.

See the example projects in the Demos directory for additional examples.