++ed by:
PERLANCAR AWNCORP KEEDI

3 PAUSE users
7 non-PAUSE users.

Laurent Dami
and 1 contributors

NAME

DBIx::DataModel::Doc::Glossary - Terms used in DBIx::DataModel documentation

DOCUMENTATION CONTEXT

This chapter is part of the DBIx::DataModel manual.

GLOSSARY

API

Application Programming Interface

association

Relationship between tables. In "UML", an association declaration states what are the participating tables, what are the multiplicities, and optionally gives names to the association itself and to the roles of the partipating tables. An association declaration in DBIx::DataModel involves similar information, except that no more than two tables can participate, and role names are mandatory.

composition

An "association" which additionally states that records of one table (components) cannot exist outside of their composite class; therefore when the composite is destroyed, the components must be destroyed as well (cascaded delete).

column

Within a "row", a column is a scalar value corresponding to a given column name. Within a "table" or "view", a column is a a list of scalar values obtained by selecting the same column name in every row of the data source. Unlike most other Perl ORMs, DBIx::DataModel has no class for representing a column: since a row is just a blessed hashref, a column is just a value in that hashref. As a matter of fact, most columns are unknown to the DBIx::DataModel layer; they are just passthrough information, directly propagated from the DBI layer to the application layer.

column type

A collection of callback functions or handlers, declared in a "schema" through the ColumnType method. This column type can then be associated with various column names in various tables; as a result, the fromDB and toDB handlers will be called automatically, respectively after reading a value from the database or before writing a value to the database.

compile time

Strictly speaking, Perl is not a compiled language; but liberally speaking, the code that runs in the initial phases of a perl program (BEGIN, CHECK, INIT) can be named "compile time".

Within DBIx::DataModel, we speak of "compile-time methods" for declarations like Schema(...), Table(...), Association(...), because these declarations usually belong to a module that will be loaded through use, and therefore will be executed at compile-time. By convention, compile-time methods start with an uppercase letter.

DB

DataBase

DBI

The generic database-independent interface for Perl -- see DBI.

DBIC

Abreviation for DBIx::Class, another "ORM" for Perl.

dbh

A DBI database handle, created by a call to "connect" in DBI.

fast statement

A "statement" for which the method reuseRow has been called : each row from the database will be retrieved into the same memory location, using DBI's fetch and bind_columns methods. This is the fastest way to get data, but it requires special care to handle each row immediately, before that row gets overwritten by the next row.

foreign key

A column or set of columns that contains the primary key of another table.

inner join

The default form of "join", that excludes null values in the join condition. Within DBIx::DataModel, inner joins are inferred automatically from the multiplicities in associations, or may be explicitly required with a bidirectional arrow: ->join(qw/table <=> role1 <=> role2/).

JDBC

Standard API to access databases from Java code. Perl code can work with JDBC databases through the DBD::JDBC proxy driver.

The JDBC API is richer than standard DBI for working with result sets : for example it has methods to move the cursor; these can be exploited from DBIx::DataModel through the DBIx::DataModel::Statement::JDBC subclass.

join

A database operation which consists of taking rows from several sources and producing new data rows. The result contains columns merged from those sources, according to the "join condition". See the join method.

join condition

A rule which states which rows from one source will be merged with which rows from another source while performing a join. A typical join condition states that the "foreign key" of the first table should match the "primary key" of the second table.

left join

A particular form of "join", in which a row with an empty "foreign key" participates in the final result (while a regular join would ignore that row). Within DBIx::DataModel, left joins are inferred automatically from the multiplicities in associations, or may be explicitly required with a directed arrow: ->join(qw/table => role1 => role2/).

multiplicity

A specification on one side of an "association", which states the minimum and maximum number of times any given record may participate in the association. Typical multiplicities are 0..*, 0..1, 1..1, 1..*. * is a shorthand for 0..*, and 1 is a shorthand for 1..1.

OO

Object-Oriented.

ORM

Object-Relational Management system : a framework of classes and methods to encapsulate interactions with a "RDBMS". DBIx::DataModel is one of several ORMs for Perl.

primary key

A column or set of columns that uniquely identifies any single row within a table.

RDBMS

Relational DataBase Management System.

role method

A method automatically installed in a "table" class when an "association" is declared. Role methods are used to get access to related records in other tables.

role name

In UML notation, each side of an association may be decorated with a "role name". These are optional in UML, like many other modeling constructs; they are used mainly when a same class participates in several associations, and disambiguation is necessary. However, when declaring an association in DBIx::DataModel, role names are mandatory, because they are used to generate methods for navigating between the two participating classes.

record

Synonym to "row".

row

A single data record resulting from a SELECT query to the RDBMS. Within DBIx::DataModel, rows are plain hashrefs ({ column_name => column_value }), blessed as instances of a "table" or a "view".

schema

A subclass of DBIx::DataModel::Schema, that holds information about its tables, views and associations, and encapsulates a "dbh".

source

Either a "table" or a "view".

SQLA

Abreviation for SQL::Abstract, the SQL generator module used by DBIx::DataModel.

statement

An instance of DBIx::DataModel::Statement, that encapsulates an SQL query. See "STATEMENT OBJECTS" in DBIx::DataModel::Doc::Design.

sth

A DBI statement handle, created by a call to "prepare" in DBI.

table

A subclass of DBIx::DataModel::Table, created by method "Table" in DBIx::DataModel::Schema, that encapsulates access to a database table (or database view).

UML

The Unified Modeling Language, a graphical notation for modeling software system. Association declarations in DBIx::DataModel closely reflect the way these are represented in UML notation (see "Association" in DBIx::DataModel::Doc::Reference).

view

A subclass of DBIx::DataModel::View, created either by a direct call to "View" in DBIx::DataModel::Schema, or (in most cases) by a call to "join" in DBIx::DataModel::Schema, that encapsulates access to a database SELECT..FROM (typically a join between several database tables).