Difference between revisions of "tiOPF"

From Lazarus wiki
Jump to navigationJump to search
Line 32: Line 32:
 
=== Authors ===
 
=== Authors ===
 
Peter Hinrichsen - Original Developer.<br>
 
Peter Hinrichsen - Original Developer.<br>
[[User:ggeldenhuys|Graeme Geldenhuys]] - Ported to Free Pascal.
+
[[User:ggeldenhuys|Graeme Geldenhuys]] - Ported to Free Pascal and current maintainer.
  
 
=== License ===
 
=== License ===

Revision as of 08:59, 27 September 2013

Deutsch (de) English (en) italiano (it) 日本語 (ja)

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 via IBX
    • Oracle via DOA
    • MySQL via ZeosLib
    • XML via MSDOM
    • XML via XMLLite
    • Paradox via BDE
    • MSAccess via ADO
    • MSSQLServer via ADO
    • Firebird via FBLib
    • Firebird via SqlDB
    • PostgreSQL via SqlDB
    • HTTP Proxy-Remote (for n-tier applications)
    • Text files (CSV 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 implementation for enabling any standard GUI component to become Object-aware. MGM currently has mediators defined for: VCL, LCL and fpGUI Toolkit.
  • 1600+ DUnit/fpcUnit tests to guarantee stability
  • 160+ pages of documentation to get you started
  • News groups for support
  • Automated, daily builds and unit testing. This is done under Linux and Windows and uses FPC & Delphi compilers.
  • Lots of demos focusing on specific parts of the framework for easy learning.
  • Cross platform. Currently tested on Windows and Linux (32 & 64-bit).

Authors

Peter Hinrichsen - Original Developer.
Graeme Geldenhuys - Ported to Free Pascal and current maintainer.

License

tiOPF uses a dual license. Developers can use the Mozilla Public License 1.1 or the Modified LGPL license (as used by FPC and Lazarus).

Download

For some years now, the tiOPF project does not make official release downloads. The tiOPF projects works on a similar principal to a "rolling release". Thus if you want the latest version with the latest features and fixes, you must get the source code from the code repository.

NOTE #1:
We have recently migrated our source code repository to Git on Sourceforge:
http://sourceforge.net/scm/?type=git&group_id=62469

You can download Git, or get instruction on how to install it, from here: http://git-scm.com/downloads

Once installed you can use the following commands to check out the source:

git clone git://tiopf.git.sourceforge.net/gitroot/tiopf/tiopf

NOTE #2:
When working with Free Pascal and tiOPF, the only supported compiler is the latest released FPC (and the related fixes branch), and the 'tiopf2' branch of tiOPF.

Once you have cloned the tiOPF repository, it will leave you in the 'master' branch with a README.txt file explaining the repository branch layout. We don't use the 'master' branch for development work.

Next step is to checkout or switch to the tiOPF2 branch, by doing the following:

 git branch tiopf2 origin/tiopf2                (1)
 git checkout tiopf2                            (2)
  1. Creates a local branch named 'tiopf2', which points to the remote tiopf2 branch.
  2. Switch to your local 'tiopf2' branch.

For a short introduction to using Git, you can refer to a message posted in the tiopf.development newsgroup. tiopf.development;article=3272. For very good and detailed documentation on Git, we highly recommend you browse through the official Git documentation as well, located here: http://git-scm.com/documentation

Dependencies / System Requirements

  • Compiler: FPC 2.6.2. The latest released FPC version.
  • Components for your required persistence layer, if it is not included with the compiler.

Status: Stable (tested on Windows, Linux and FreeBSD)

Issues: None

Installation

The Packages

Inside the Source\Compilers\FPC directory there are four packages.

tiOPF.lpk
Core units (run-time only package)
tiOPFGUI.lpk
GUI related units and components [deprecated] (run-time only package).
tiOPFGUIDsgn.lpk
Registers/Installs the components into the Lazarus component palette (design-time only package). The GUI components used under Lazarus are still experimental and under heavy development. It is recommended to get frequent updates from SubVersion if they are going to be used. [deprecated]
tiOPFLCL.lpk
GUI related units which replaces tiOPFGUI.lpk and does not contain any of the tiOPF custom GUI components. (run-time only package)
tiOPFHelpIntegration.lpk
Integrates the fpdoc generated help files into Lazarus's help system (design-time only package)

The Setup

  • Unzip the zip file or check out the source from SubVersion 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
  • Open the tiOPFLCL.lpk package and click Compile

Optional

  • Open the tiOPFHelpIntegration.lpk package and click Compile and the Install (Lazarus should rebuild and restart).

NOTE #1
I included the SqlDB database components as the default persistence layer for Free Pascal in the tiOPF.lpk package. This should run out of the box, because SqlDB in included with the Free Pascal Compiler. If you don't need this persistence layer you can simply disable it as described below.

Persistence layers are controlled by a Compiler Directive under Compiler Options -> Other -> Custom Options. eg: The LINK_FBL directive relates to the FBLib components. The LINK_SQLDB_IB directive relates to the SqlDB (Interbase/Firebird) components. For all the available options see the end of the tiOPFManager.pas unit.

NOTE #2
For the Integrated Help to work, Lazarus needs to know how to find the html help files. Please read the tiOPFHelpIntegration.txt file located in \Source\Compilers\FPC for further instructions.

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 ready to create objects descending from TtiObject or TtiObjectList.

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