Difference between revisions of "tiOPF"

From Free Pascal wiki
Jump to navigationJump to search
(Fixed link)
 
(65 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 +
{{tiOPF}}
  
===About===
+
=== 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.  
+
The [http://tiopf.sourceforge.net 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 since 1999. It is free, open source, and available for immediate download with full source code.  
  
 
Some of the key features of the tiOPF include:
 
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.
+
* Lets you build an object oriented application that can swap databases with the flick of a switch 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 [[Zeos tutorial|Zeos]]
 +
**MySQL via [[SQLdb_Package|SqlDB]]
 +
**XML via MSDOM
 +
**XML via XMLLite
 +
**Paradox via BDE
 +
**MS Access via ADO
 +
**MS SQL Server via ADO
 +
**MS SQL Server via SqlDB
 +
**Firebird via FBLib
 +
**Firebird via SqlDB
 +
**Firebird via Zeos
 +
**PostgreSQL via SqlDB
 +
**HTTP Remote Persistence (for n-tier applications with built-in generic application server)
 +
**Text files (CSV and TAB files)
 
* Family of abstract base classes for building a complex object model
 
* Family of abstract base classes for building a complex object model
* 27 Persistent object aware components for building complex GUIs (Delphi only).
+
* 27 Persistent Object-aware components for building complex GUIs (Delphi only).
* Model-GUI-Mediators for enabling any standard GUI component to become Object Aware.
+
* Model-GUI-Mediators implementation for enabling any standard GUI component to become Object-aware. MGM currently has mediators defined for: VCL, LCL and [[fpGUI|fpGUI Toolkit]].
* 1400+ DUnit/fpcUnit tests to guarantee stability
+
* 1600+ DUnit2/[[FPTest]] tests to guarantee stability
* 160 pages of documentation to get you started
+
* 160+ pages of documentation to get you started
 
* News groups for support
 
* News groups for support
* Automated, daily builds and unit testing
+
* 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.
 
* Lots of demos focusing on specific parts of the framework for easy learning.
* Cross platform. Currently tested on Windows and Linux.
+
* Cross platform. Currently tested on Windows, Linux and FreeBSD (32 & 64-bit).
  
===Authors===
+
=== Authors ===
Peter Hinrichsen - Original Designer.<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 ===
[http://opensource.org/licenses/mozilla1.1.php Mozilla Public License] (please contact the author if the MPL doesn't work with your project licensing)
+
tiOPF uses a dual license. Developers can use the [http://opensource.org/licenses/mozilla1.1.php Mozilla Public License 1.1] or the Modified LGPL license (as used by libraries of FPC and Lazarus).
 
===Download===
 
The latest stable release can be found on the [http://www.techinsite.com.au/tiOPF/ TechInsite] page.<br>
 
The latest development code can be found on the SubVersion server as follows
 
<tt>svn co http://tiopf.techinsite.com.au/svn/tiOPF2/Trunk tiOPF2</tt>
 
or downloaded as a nightly build zip file from the [http://tiopf.techinsite.com.au/DailyBuild/Index.html DailyBuild] page.
 
  
===Dependencies / System Requirements===
+
=== Support ===
* Compiler: Free Pascal 2.0.2
+
The best way to get support is by signing up to tiopf.support news group — see here: http://tiopf.sourceforge.net/Support.shtml
* 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.)
+
=== 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 Git code repository.
  
Issues: None
+
You can use the following commands to check out the source:
  
===Installation===
+
git clone <nowiki>git://tiopf.git.sourceforge.net/gitroot/tiopf/tiopf</nowiki>
* Unzip the zip file to a location of your choice.
+
 
* Open Lazarus
+
You will now have a 'tiopf' directory containing the tiOPF repository. By default Git will also have checked out the 'master' branch for you. The tiOPF project doesn't use the 'master' branch for development, so switch to the 'tiopf2' branch as follows:
* Open the package tiOPF.lpk with Component/Open package file (.lpk) located in the Source\Compilers\FPC directory.
+
 
 +
  git branch tiopf2 origin/tiopf2                (1)
 +
  git checkout tiopf2                            (2)
 +
 
 +
# Creates a local branch named 'tiopf2', which points to the remote tiopf2 branch.
 +
# Switch to your local 'tiopf2' branch.
 +
 
 +
Another simpler way of doing this is:
 +
 
 +
git clone <nowiki>--branch=tiopf2 git://tiopf.git.sourceforge.net/gitroot/tiopf/tiopf</nowiki>
 +
 
 +
You will now have a 'tiopf' directory containing the tiOPF repository.
 +
 
 +
{{Note|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.}}
 +
 
 +
 
 +
For a short introduction to using Git, you can refer to a message posted in the tiopf.development newsgroup. [http://geldenhuys.co.uk/webnews/webnews.cgi?user=anonymous;group=tiopf.development;article=3272 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 http://git-scm.com/documentation]
 +
 
 +
=== Dependencies / System Requirements ===
 +
* Compiler: FPC 2.6.4. 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 <tiopf>\Compilers\FPC directory there are four packages.
 +
; tiOPF.lpk : Core units (run-time only package)
 +
; tiOPFGUI.lpk : GUI related units and tiOPF+LCL custom components ['''deprecated'''] (run-time only package).
 +
; tiOPFGUIDsgn.lpk : Registers/Installs the tiOPF+LCL custom components into the Lazarus component palette (design-time only package). The tiOPF+LCL custom GUI components used under Lazarus are unmaintained and '''deprecated'''. It is preferred to use the Model-GUI-Mediator components instead. See tiOPFLCL.lpk package instead.
 +
; tiOPFLCL.lpk : GUI related units which replaces tiOPFGUI.lpk and does not contain any of the tiOPF custom GUI components. This packages uses the Mediators which makes standard LCL components "object-aware" and is the preferred way of hooking up your UI to you business objects. (run-time only package)
 +
; tiOPFHelpIntegration.lpk : Integrates the fpdoc generated help files into Lazarus's help system (design-time only package)
 +
 
 +
==== The Setup ====
 +
* Open Lazarus IDE
 +
* Open the package ''tiOPF.lpk'' with 'Package -> Open Package File (.lpk)' located in the <tiopf>\Compilers\FPC\ directory.
 
* Click on Compile
 
* Click on Compile
 +
* Open the ''tiOPFLCL.lpk'' package and click Compile
 +
 +
Optional
  
<u>NOTE</u><br>
+
* Open the ''tiOPFHelpIntegration.lpk'' package and click Compile and the Install (Lazarus should rebuild and restart).
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
+
<u>NOTE #1</u><br>
copy tiDefines.inc ..\GUI
+
The SqlDB+Firebird database components are set as the default persistence layer for Free Pascal in the tiOPF.lpk package. This was simply done because SqlDB in included with the Free Pascal Compiler, and Firebird is a popular database option. If you don't need this persistence layer you can simply disable it as described below.
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: 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.
  
Persistence layers are controlled by a Compiler Directive under Compiler Options -> Other -> Custom Options. eg: LINK_FBL = FBLib components.
+
<u>NOTE #2</u><br>
For more all the available options see the end of the tiOPFManager.pas unit.
+
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 <tiopf>\Compilers\FPC\ for further instructions.
  
===Usage===
+
=== Usage ===
 
In Lazarus, open your project and add tiOPF as a Required Package ''(Project -> Project Inspector -> Add)''.  Include ''tiObject'' in your uses clause.
 
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.
+
You are now ready to create objects descending from TtiObject or TtiObjectList.
  
 
See the example projects in the Demos directory for additional examples.
 
See the example projects in the Demos directory for additional examples.
 +
 +
=== Links ===
 +
tiOPF home page: http://tiopf.sourceforge.net/
 +
 +
==== Basics about tiOPF and Design Patterns ====
 +
For people who are searching basics about tiOPF or Design Patterns, there are a couple of published articles at (http://geldenhuys.co.uk/articles/)
 +
 +
Written by Graeme Geldenhuys
 +
 +
;2008-08: Simple Factory Pattern (download pdf) [150KB]
 +
;2008-09: Model-GUI-Mediator (download pdf - 251KB) & (source code - 9KB)
 +
;2008-11: Iterator Pattern (download pdf - 147KB) & (source code - 4KB)
 +
;2009-01: The Adapter Pattern (download pdf) [237KB]
 +
;2009-02: Intro to Git - source code management (download pdf) [257KB]
 +
;2009-03: The State Pattern (download pdf) [217KB]
 +
;2009-07: Relationship Manager (download pdf) [375KB]
 +
;2009-09: Hierarchies in SQL - Nested Sets (download pdf) [163KB]
 +
;2011-12: The Facade Design Pattern (download pdf) [297KB]
 +
 +
[[Category:Databases]]
 +
[[Category:Framework]]

Latest revision as of 16:15, 23 October 2017

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 since 1999. 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 switch 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 Zeos
    • MySQL via SqlDB
    • XML via MSDOM
    • XML via XMLLite
    • Paradox via BDE
    • MS Access via ADO
    • MS SQL Server via ADO
    • MS SQL Server via SqlDB
    • Firebird via FBLib
    • Firebird via SqlDB
    • Firebird via Zeos
    • PostgreSQL via SqlDB
    • HTTP Remote Persistence (for n-tier applications with built-in generic application server)
    • 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+ DUnit2/FPTest 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, Linux and FreeBSD (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 libraries of FPC and Lazarus).

Support

The best way to get support is by signing up to tiopf.support news group — see here: http://tiopf.sourceforge.net/Support.shtml

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 Git code repository.

You can use the following commands to check out the source:

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

You will now have a 'tiopf' directory containing the tiOPF repository. By default Git will also have checked out the 'master' branch for you. The tiOPF project doesn't use the 'master' branch for development, so switch to the 'tiopf2' branch as follows:

 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.

Another simpler way of doing this is:

git clone --branch=tiopf2 git://tiopf.git.sourceforge.net/gitroot/tiopf/tiopf

You will now have a 'tiopf' directory containing the tiOPF repository.

Light bulb  Note: 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.


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.4. 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 <tiopf>\Compilers\FPC directory there are four packages.

tiOPF.lpk
Core units (run-time only package)
tiOPFGUI.lpk
GUI related units and tiOPF+LCL custom components [deprecated] (run-time only package).
tiOPFGUIDsgn.lpk
Registers/Installs the tiOPF+LCL custom components into the Lazarus component palette (design-time only package). The tiOPF+LCL custom GUI components used under Lazarus are unmaintained and deprecated. It is preferred to use the Model-GUI-Mediator components instead. See tiOPFLCL.lpk package instead.
tiOPFLCL.lpk
GUI related units which replaces tiOPFGUI.lpk and does not contain any of the tiOPF custom GUI components. This packages uses the Mediators which makes standard LCL components "object-aware" and is the preferred way of hooking up your UI to you business objects. (run-time only package)
tiOPFHelpIntegration.lpk
Integrates the fpdoc generated help files into Lazarus's help system (design-time only package)

The Setup

  • Open Lazarus IDE
  • Open the package tiOPF.lpk with 'Package -> Open Package File (.lpk)' located in the <tiopf>\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
The SqlDB+Firebird database components are set as the default persistence layer for Free Pascal in the tiOPF.lpk package. This was simply done because SqlDB in included with the Free Pascal Compiler, and Firebird is a popular database option. 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 <tiopf>\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.

Links

tiOPF home page: http://tiopf.sourceforge.net/

Basics about tiOPF and Design Patterns

For people who are searching basics about tiOPF or Design Patterns, there are a couple of published articles at (http://geldenhuys.co.uk/articles/)

Written by Graeme Geldenhuys

2008-08
Simple Factory Pattern (download pdf) [150KB]
2008-09
Model-GUI-Mediator (download pdf - 251KB) & (source code - 9KB)
2008-11
Iterator Pattern (download pdf - 147KB) & (source code - 4KB)
2009-01
The Adapter Pattern (download pdf) [237KB]
2009-02
Intro to Git - source code management (download pdf) [257KB]
2009-03
The State Pattern (download pdf) [217KB]
2009-07
Relationship Manager (download pdf) [375KB]
2009-09
Hierarchies in SQL - Nested Sets (download pdf) [163KB]
2011-12
The Facade Design Pattern (download pdf) [297KB]