Getting Started with Eiffel Binding

This note describes how to get started with the MATISSE Eiffel Binding. 

The MATISSE Eiffel binding consists of a set of Eiffel classes which provides persistence to Eiffel classes and a C library which supports these classes.

How to run the example Eiffel programs

Before running the example, you  need to install the MATISSE 4.x. MT_INSTALL_DIR is the top directory of the MATISSE and BINDING_INSTALL_DIR is the top directory of the MATISSE Eiffel Binding.

(A) If you’re running Windows

(A-1) Be sure that your environment variable path includes ‘MT_INSTALL_DIR\bin’.
(A-2) Create and initialize a new MATISSE database using mts_dba tool. From the Windows Start menu, start mts_dba from the MATISSE Start Menu Program.
To create and initialize a new database, in the mts_dba tool, (1) select “Create...” from the Database menu, (2) complete the configuration file (specify NAME and SILO at least) (3) then click on the “Initialize” from the Database menu. For the details, please see the document “MATISSE DBA Guide”
(A-3) From the Windows Start menu or from the Control Panel, open a console (MS-DOS-style) window.
(A-4) In the console window, go to the BINDING_INSTALL_DIR\example directory
(A-5) From the console window, load the database schema into the newly created database using the utility mt_odl.
	> mt_odl -h <hostname> -db <databasename> example.odl
(A-6) From the console window, generate the Eiffel persistent classes using the utility mt_odl.
	> mt_odl -eiffel example.odl
(A-7) Start the EiffelBench and select the BINDING_INSTALL_DIR\example directory as a project directory.
(A-8) In the EiffelBench Project Tool, click on the System hole and select the Ace.ace file. You need the EiffelTime library from ISE. If it is installed in the different directory from the one specified in the Ace.ace file, edit and change it. You need to specify the C library file for MATISSE. By default, it is specified as “C:\matisse\lib\matisse.lib”. If the file is installed in the different directory, edit and change it.
(A-9) Compile the project. Click on the Melt button in the EiffelBench window.
(A-10) After the compilation, run the system with two arguments, the host name and database name of your database.
(A-11) The sample application reads a text file as sample data and creates some objects in the database. Then it executes several queries on those objects. You may edit the procedure “make” of the class EXAMPLE_APP and execute the queries one by one.

How to generate Eiffel source code with mt_odl

You can write your schema in an ODL file, named schema.odl for instance. To know more about how to write an ODL file, please refer to MATISSE ODL Programming Guide.
In order to generate Eiffel source code, call up the utility mt_odl with the option eiffel.
	mt_odl -eiffel schema.odl
This utility generates Eiffel persistent class files in the directory where the utility is executed.