2015-04-19

The Setup:

← Older revision

Revision as of 08:57, 19 April 2015

(6 intermediate revisions by one user not shown)

Line 2:

Line 2:

=== About ===

=== About ===



The [http://www.tiopf.com 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://www.tiopf.com 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:

+

* 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

**Interbase via IBX

**Oracle via DOA

**Oracle via DOA



**MySQL via
ZeosLib

+

**MySQL via
Zeos

+

**MySQL via SqlDB

**XML via MSDOM

**XML via MSDOM

**XML via XMLLite

**XML via XMLLite

**Paradox via BDE

**Paradox via BDE



**
MSAccess
via ADO

+

**
MS Access
via ADO



**
MSSQLServer
via ADO

+

**
MS SQL Server
via ADO

+

**MS SQL Server via SqlDB

**Firebird via FBLib

**Firebird via FBLib

**Firebird via SqlDB

**Firebird via SqlDB

+

**Firebird via Zeos

**PostgreSQL via SqlDB

**PostgreSQL via SqlDB



**HTTP
Proxy-
Remote (for n-tier applications)

+

**HTTP Remote
Persistence
(for n-tier applications
with built-in generic application server
)

**Text files (CSV and TAB files)

**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 implementation for enabling any standard GUI component to become Object-aware. MGM currently has mediators defined for: VCL, LCL and [[fpGUI|fpGUI Toolkit]].

* 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]].



* 1600+
DUnit
/[[
fpcunit|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. This is done under Linux and Windows and uses FPC & Delphi compilers.

* 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 (32 & 64-bit).

+

* Cross platform. Currently tested on Windows
,
Linux
and FreeBSD
(32 & 64-bit).

=== Authors ===

=== Authors ===

Line 38:

Line 41:

=== Download ===

=== 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.

+

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.



'''NOTE #1:'''<br>

+

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



We have recently migrated our source code repository to Git on Sourceforge:<br>

+



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 http://git-scm.com/downloads]

+



+



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

+

git clone <nowiki>git://tiopf.git.sourceforge.net/gitroot/tiopf/tiopf</nowiki>

git clone <nowiki>git://tiopf.git.sourceforge.net/gitroot/tiopf/tiopf</nowiki>



You will now have a 'tiopf' directory containing tiOPF repository. By default Git will also have checked out the 'master' branch for you.
After cloning the the repository, go to the 'tiopf' directory on your local drive.

+

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
:



+



'''NOTE #2:'''<br>

+



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 branch tiopf2 origin/tiopf2                (1)

Line 64:

Line 54:

# Creates a local branch named 'tiopf2', which points to the remote tiopf2 branch.

# Creates a local branch named 'tiopf2', which points to the remote tiopf2 branch.

# Switch to your local 'tiopf2' branch.

# Switch to your local 'tiopf2' branch.

+

+

'''NOTE:'''<br>

+

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]

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 ===

=== Dependencies / System Requirements ===



* Compiler: FPC 2.6.
2
. The latest released FPC version.

+

* Compiler: FPC 2.6.
4
. The latest released FPC version.

* Components for your required persistence layer, if it is not included with the compiler.

* Components for your required persistence layer, if it is not included with the compiler.

Line 77:

Line 70:

=== Installation ===

=== Installation ===

==== The Packages ====

==== The Packages ====



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

+

Inside the
<tiopf>
\Compilers\FPC directory there are four packages.

; tiOPF.lpk : Core units (run-time only package)

; tiOPF.lpk : Core units (run-time only package)



; tiOPFGUI.lpk : GUI related units and components ['''deprecated'''] (run-time only package).

+

; tiOPFGUI.lpk : GUI related units and
tiOPF+LCL custom
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'''
]

+

; 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. (run-time only package)

+

; 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)

; tiOPFHelpIntegration.lpk : Integrates the fpdoc generated help files into Lazarus's help system (design-time only package)

==== The Setup ====

==== The Setup ====



* Unzip the zip file or check out the source from SubVersion to a location of your choice.

+

* Open Lazarus
IDE



* Open Lazarus

+

* Open the package ''tiOPF.lpk'' with
'Package ->
Open
Package File
(.lpk)
'
located in the
<tiopf>
\Compilers\FPC
\
directory.



* Open the package ''tiOPF.lpk'' with
Component/
Open
package file
(.lpk) located in the
Source
\Compilers\FPC directory.

+

* Click on Compile

* Click on Compile

* Open the ''tiOPFLCL.lpk'' package and click Compile

* Open the ''tiOPFLCL.lpk'' package and click Compile

Line 96:

Line 88:

<u>NOTE #1</u><br>

<u>NOTE #1</u><br>



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.

+

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.

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.

Line 102:

Line 94:

<u>NOTE #2</u><br>

<u>NOTE #2</u><br>



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.

+

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 ===

Show more