blob: da950e2bd0ed556e832b26dd3f8254e812fcf493 [file] [log] [blame]
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Understanding the Technical Background (CDO Model Repository Documentation)</title>
<link rel="stylesheet" href="../book.css" charset="UTF-8" type="text/css">
<noscript></noscript>
<script type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Understanding the Technical Background (CDO Model Repository Documentation)";
}
}
</script>
</head>
<body bgcolor="white" onload="windowTitle();">
<!-- <div class="help_breadcrumbs breadcrumbs_top"><a href="../Overview.html" title="CDO Model Repository Documentation">CDO Model Repository Documentation</a> > <a href="index.html" title="Category in CDO Model Repository Documentation">User's Guide</a></div> -->
<table border="0">
<tr>
<td width="100%"><h1>Understanding the Technical Background</h1></td>
<td align="right" valign="middle" nowrap><a href="Doc08_Collaborating.html" title="Backward to Collaborating in Real-Time"><img src="../../images/backward.png" border="0"></a>&nbsp;<a href="../operators/index.html" title="Forward to Operator's Guide"><img src="../../images/forward.png" border="0"></a></td>
</tr>
</table>
<p class="author">Author: Eike Stepper</p>
<p>
This article explains the relationship between the main concepts that are exposed in the
<a href="Doc01_UserInterface.html" title="Article in CDO Model Repository Documentation">CDO User Interface</a> and their underlying technical core concepts.
<p align="center"><img src="tech-overview.png">
<p>
<b>Table of Contents</b> <p>
<table border="0">
<tr><td>1&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundModelElements" title="Chapter in CDO Model Repository Documentation">Technical Background of Model Elements</a></td></tr>
<tr><td></td><td>1.1&nbsp;</td><td class="te" colspan="3"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundNativeModels" title="Chapter in CDO Model Repository Documentation">Native Models</a></td></tr>
<tr><td></td><td>1.2&nbsp;</td><td class="te" colspan="3"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundLegacyModels" title="Chapter in CDO Model Repository Documentation">Legacy Models</a></td></tr>
<tr><td></td><td>1.3&nbsp;</td><td class="te" colspan="3"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundDynamicModels" title="Chapter in CDO Model Repository Documentation">Dynamic Models</a></td></tr>
<tr><td>2&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundRepositories" title="Chapter in CDO Model Repository Documentation">Technical Background of Repositories</a></td></tr>
<tr><td>3&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundCheckouts" title="Chapter in CDO Model Repository Documentation">Technical Background of Checkouts</a></td></tr>
<tr><td>4&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundSessions" title="Chapter in CDO Model Repository Documentation">Technical Background of Sessions</a></td></tr>
<tr><td>5&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundViews" title="Chapter in CDO Model Repository Documentation">Technical Background of Views</a></td></tr>
<tr><td>6&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundTransactions" title="Chapter in CDO Model Repository Documentation">Technical Background of Transactions</a></td></tr>
<tr><td>7&nbsp;</td><td class="te" colspan="4"><a href="Doc09_TechnicalBackground.html#Doc_BackgroundCompare" title="Chapter in CDO Model Repository Documentation">Technical Background of the Compare Integration</a></td></tr>
</table>
</p>
<h2><a name="Doc_BackgroundModelElements"></a>1&nbsp;&nbsp;Technical Background of Model Elements</h2>
<p>
Model elements are <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EObject.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EObjects</code></a>.
<p>
EObjects are instances of concrete <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EClass.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EClasses</code></a>, sometimes referred to as model element types.
<p>
EClasses are contained by <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EPackage.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EPackages</code></a>, often referred to as meta models and sometimes less specifically as just models.
<p>
EPackages are registered in the <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EPackage.Registry.html" target="_blank" title="Interface in org.eclipse.emf.ecore.EPackage"><code>EPackage.Registry</code></a>.<p><b>See Also:</b></p>
<ul>
<li><a href="http://help.eclipse.org/mars/nav/21" title="Article in CDO Model Repository Documentation">EMF Developer Guide</a></li>
</ul>
<h3><a name="Doc_BackgroundNativeModels"></a>1.1&nbsp;&nbsp;Native Models</h3>
<p>
The term "native model" refers to an <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EPackage.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EPackage</code></a> that is <a href="../programmers/client/Doc02_PreparingModels.html#Doc_GeneratingModel" title="Chapter in CDO Model Repository Documentation">generated</a>
with some CDO-specific <a href="../programmers/client/Doc02_PreparingModels.html#Doc_MigratingManually" title="Chapter in CDO Model Repository Documentation">options</a> to fully exploit CDO's unprecedented
characteristics with respect to scalability and performance.
<p>
Native model elements are lazily loaded when they are needed and automatically garbage-collected when they are no longer needed.
Repositories with native model elements can scale to arbitrary sizes. Clients may not be able to load all objects
of these large repositories at the same time, but they are able, for example, to iterate all objects of a large repository
without worrying about memory management.
<p>
Technically native model elements are instances of the Java class <a href="../../javadoc/org/eclipse/emf/internal/cdo/CDOObjectImpl.html" title="Class in org.eclipse.emf.internal.cdo"><code>CDOObjectImpl</code></a>.<p><b>See Also:</b></p>
<ul>
<li><a href="http://thegordian.blogspot.de/2008/11/how-scalable-are-my-models.html" title="Article in CDO Model Repository Documentation">CDO Scalability</a></li>
<li><a href="../programmers/client/Doc02_PreparingModels.html" title="Article in CDO Model Repository Documentation">Preparing EMF Models for CDO</a></li>
</ul>
<h3><a name="Doc_BackgroundLegacyModels"></a>1.2&nbsp;&nbsp;Legacy Models</h3>
<p>
Generating or regenerating an <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EPackage.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EPackage</code></a> with the CDO-specific <a href="../programmers/client/Doc02_PreparingModels.html#Doc_MigratingManually" title="Chapter in CDO Model Repository Documentation">options</a>
(as explained in <a href="Doc09_TechnicalBackground.html#Doc_BackgroundNativeModels" title="Chapter in CDO Model Repository Documentation">Native Models</a>) is not always possible, for example if an EPackage has already
been generated by a third party. In these cases the original generated EPackage can still be used with CDO;
and is then referred to as a "legacy model".
<p>
The integration of legacy models with CDO is based on CDOLegacyAdapters.
<p>
Legacy model elements are not loaded lazily and not automatically garbage-collected.
<h3><a name="Doc_BackgroundDynamicModels"></a>1.3&nbsp;&nbsp;Dynamic Models</h3>
<p>
It is not strictly necessary for an <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EPackage.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EPackage</code></a> to be generated into Java code to be used with CDO.
An EPackage can also be loaded dynamically at runtime (see <a href="../programmers/client/Doc02_PreparingModels.html#Doc_CreatingEcore" title="Chapter in CDO Model Repository Documentation">Creating an Ecore Model</a> for an example of the
XML representation of an EPackage).
<p>
Technically dynamic model elements are instances of the Java class DynamicCDOObjectImpl.
<p>
Dynamic model elements share the characteristics of <a href="Doc09_TechnicalBackground.html#Doc_BackgroundNativeModels" title="Chapter in CDO Model Repository Documentation">native</a> model elements
with respect to enhanced scalability and performance,
<h2><a name="Doc_BackgroundRepositories"></a>2&nbsp;&nbsp;Technical Background of Repositories</h2>
<p>
The term "repository" is a slightly ambiguous in CDO, as it may refer to both a server-side / core-level <a href="../../javadoc/org/eclipse/emf/cdo/server/IRepository.html" title="Interface in org.eclipse.emf.cdo.server"><code>IRepository</code></a>
and a client-side / UI-level <a href="../../javadoc/org/eclipse/emf/cdo/explorer/repositories/CDORepository.html" title="Interface in org.eclipse.emf.cdo.explorer.repositories"><code>CDORepository</code></a>.
<p>
An IRepository is a "real" repository backed by a physical database (of one of various <a href="../../javadoc/org/eclipse/emf/cdo/server/IStore.html" title="Interface in org.eclipse.emf.cdo.server"><code>forms)</code></a>. In production
such repositories typically exist in a CDO server
that provides remote access through one or more <a href="../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/tcp/ITCPConnector.html" title="Interface in org.eclipse.net4j.tcp"><code>ITCPConnectors</code></a>.
The <a href="../operators/index.html" title="Category in CDO Model Repository Documentation">Operator's Guide</a> explains how to configure and operate a CDO server.
<p>
A CDORepository is more of a <a href="Doc02_ManagingRepositories.html#Doc_CreatingRepositories" title="Chapter in CDO Model Repository Documentation">configured connection</a> to a "real" IRepository, which
is remembered across Eclipse sessions. In the case of a <a href="Doc02_ManagingRepositories.html#Doc_LocalRepositories" title="Chapter in CDO Model Repository Documentation">local repository</a> (connection)
an internal IRepository is created with an <a href="../../../org.eclipse.net4j.db.doc/javadoc/org/eclipse/net4j/db/h2/H2Adapter.html" title="Class in org.eclipse.net4j.db.h2"><code>H2</code></a> database <a href="Doc02_ManagingRepositories.html#Doc_RepositoryShowInSystemExplorer" title="Chapter in CDO Model Repository Documentation">stored on the local disk</a>.
<p>
Internally a <a href="../../javadoc/org/eclipse/emf/cdo/explorer/repositories/CDORepository.html#isConnected()" title="Method in org.eclipse.emf.cdo.explorer.repositories.CDORepository"><code>connected</code></a> CDORepository maintains a single <a href="../../javadoc/org/eclipse/emf/cdo/session/CDOSession.html" title="Interface in org.eclipse.emf.cdo.session"><code>CDOSession</code></a> to the underlying IRepository.
This session is shared by all <a href="../../javadoc/org/eclipse/emf/cdo/view/CDOView.html" title="Interface in org.eclipse.emf.cdo.view"><code>views</code></a> and <a href="../../javadoc/org/eclipse/emf/cdo/transaction/CDOTransaction.html" title="Interface in org.eclipse.emf.cdo.transaction"><code>transactions</code></a> of all <a href="../../javadoc/org/eclipse/emf/cdo/explorer/checkouts/CDOCheckout.html" title="Interface in org.eclipse.emf.cdo.explorer.checkouts"><code>checkouts</code></a>
from that CDORepository.<p><b>See Also:</b></p>
<ul>
<li><a href="Doc02_ManagingRepositories.html" title="Article in CDO Model Repository Documentation">Managing Repositories</a></li>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundSessions" title="Chapter in CDO Model Repository Documentation">Technical Background of Sessions</a></li>
</ul>
<h2><a name="Doc_BackgroundCheckouts"></a>3&nbsp;&nbsp;Technical Background of Checkouts</h2>
<p>
A <a href="../../javadoc/org/eclipse/emf/cdo/explorer/checkouts/CDOCheckout.html" title="Interface in org.eclipse.emf.cdo.explorer.checkouts"><code>CDOCheckout</code></a> is not necessarily a physical copy of a repository on the local disk (only <a href="Doc04_CheckingOut.html#Doc_OfflineCheckouts" title="Chapter in CDO Model Repository Documentation">offline checkouts</a>
maintain a locally replicated repository copy). More generally they represent the following two aspects:
<ul>
<li> A reference to a configured <a href="../../javadoc/org/eclipse/emf/cdo/explorer/repositories/CDORepository.html" title="Interface in org.eclipse.emf.cdo.explorer.repositories"><code>CDORepository</code></a> as a way to use the internal <a href="../../javadoc/org/eclipse/emf/cdo/session/CDOSession.html" title="Interface in org.eclipse.emf.cdo.session"><code>CDOSession</code></a> of that CDORepository.
<li> The <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="Interface in org.eclipse.emf.cdo.common.branch"><code>CDOBranchPoint</code></a> information, i.e., <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getBranch()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>branch</code></a> and <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getTimeStamp()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>time stamp</code></a>,
that is needed to open <a href="../../javadoc/org/eclipse/emf/cdo/view/CDOView.html" title="Interface in org.eclipse.emf.cdo.view"><code>CDOViews</code></a> and <a href="../../javadoc/org/eclipse/emf/cdo/transaction/CDOTransaction.html" title="Interface in org.eclipse.emf.cdo.transaction"><code>CDOTransactions</code></a> on the shared CDOSession of
the referenced CDORepository
</ul>
<p>
A CDOCheckout internally maintains a main CDOView that is, for example, used to provide the resources and model elements that
are displayed in the <a href="Doc01_UserInterface.html#Doc_ProjectExplorerIntegration" title="Chapter in CDO Model Repository Documentation">Project Explorer</a>. As objects that are provided by CDOViews are read-only
any modification action on these objects, for example as offered in the various context menus or triggered by drag and drop events,
operates on <a href="../../javadoc/org/eclipse/emf/cdo/view/CDOView.html#getObject(T)" title="Method in org.eclipse.emf.cdo.view.CDOView"><code>transactional copies</code></a> of the objects in the context of a background thread.
<p>
Each <a href="Doc07_UsingModels.html#Doc_EditingModelElementsEditor" title="Chapter in CDO Model Repository Documentation">model editor</a> opened on a resource or model element of a CDOCheckout typically
(but depending on the implementation of that editor) maintains its own CDOTransaction to isolate changes and locks from other
views and transactions. Typically the save action of a model editor delegates directly to the <a href="../../javadoc/org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)" title="Method in org.eclipse.emf.cdo.transaction.CDOUserTransaction"><code>commit</code></a>
method of its associated CDOTransaction.
<h2><a name="Doc_BackgroundSessions"></a>4&nbsp;&nbsp;Technical Background of Sessions</h2>
<p>
A <a href="../../javadoc/org/eclipse/emf/cdo/session/CDOSession.html" title="Interface in org.eclipse.emf.cdo.session"><code>CDOSession</code></a> is the technical representation of a <a href="../../javadoc/org/eclipse/emf/cdo/common/protocol/CDOProtocol.html" title="Interface in org.eclipse.emf.cdo.common.protocol"><code>CDOProtocol</code></a> connection to an <a href="../../javadoc/org/eclipse/emf/cdo/server/IRepository.html" title="Interface in org.eclipse.emf.cdo.server"><code>IRepository</code></a>.
On the transport level this connection is provided by an <a href="../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/connector/IConnector.html" title="Interface in org.eclipse.net4j.connector"><code>IConnector</code></a> / <a href="../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/acceptor/IAcceptor.html" title="Interface in org.eclipse.net4j.acceptor"><code>IAcceptor</code></a> pair.
<p align="center"><img src="tech-sessions.png">
<p><b>See Also:</b></p>
<ul>
<li><a href="Doc01_UserInterface.html#Doc_SessionsView" title="Chapter in CDO Model Repository Documentation">CDO Sessions View</a></li>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundViews" title="Chapter in CDO Model Repository Documentation">Technical Background of Views</a></li>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundTransactions" title="Chapter in CDO Model Repository Documentation">Technical Background of Transactions</a></li>
</ul>
<h2><a name="Doc_BackgroundViews"></a>5&nbsp;&nbsp;Technical Background of Views</h2>
<p>
A <a href="../../javadoc/org/eclipse/emf/cdo/view/CDOView.html" title="Interface in org.eclipse.emf.cdo.view"><code>CDOView</code></a> is a technical facility that provides a client application with all the models and model elements in a repository
for a specific <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getTimeStamp()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>point in time</code></a> and in a specific <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getBranch()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>branch</code></a>.
The model elements provided by a CDOView are <a href="../../javadoc/org/eclipse/emf/cdo/util/ReadOnlyException.html" title="Exception in org.eclipse.emf.cdo.util"><code>read-only</code></a>.
<p align="center"><img src="tech-views.png">
<p><b>See Also:</b></p>
<ul>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundSessions" title="Chapter in CDO Model Repository Documentation">Technical Background of Sessions</a></li>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundCheckouts" title="Chapter in CDO Model Repository Documentation">Technical Background of Checkouts</a></li>
</ul>
<h2><a name="Doc_BackgroundTransactions"></a>6&nbsp;&nbsp;Technical Background of Transactions</h2>
<p>
A <a href="../../javadoc/org/eclipse/emf/cdo/transaction/CDOTransaction.html" title="Interface in org.eclipse.emf.cdo.transaction"><code>CDOTransaction</code></a> is a technical facility that provides a client application with all the latest models
and model elements in a repository in a specific <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html#getBranch()" title="Method in org.eclipse.emf.cdo.common.branch.CDOBranchPoint"><code>branch</code></a>.
The model elements provided by a CDOTransaction are writable.
Changes to these model elements must be <a href="../../javadoc/org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)" title="Method in org.eclipse.emf.cdo.transaction.CDOUserTransaction"><code>committed</code></a> to make them
persistent in the repository and to distribute them to the views and transactions of other users.
<p align="center"><img src="tech-transactions.png">
<p><b>See Also:</b></p>
<ul>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundSessions" title="Chapter in CDO Model Repository Documentation">Technical Background of Sessions</a></li>
<li><a href="Doc09_TechnicalBackground.html#Doc_BackgroundCheckouts" title="Chapter in CDO Model Repository Documentation">Technical Background of Checkouts</a></li>
</ul>
<h2><a name="Doc_BackgroundCompare"></a>7&nbsp;&nbsp;Technical Background of the Compare Integration</h2>
<p>
With CDO both EMF Compare editors and EMF Merge editors are instrumented to utilize an optimized CDO mechanism in order to compute
matches in a very efficient and scalable way. This mechanism consists of special <a href="../../javadoc/org/eclipse/emf/spi/cdo/CDOSessionProtocol.html#loadMergeData(org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo, org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo)" title="Method in org.eclipse.emf.spi.cdo.CDOSessionProtocol"><code>client-server protocol</code></a>
and remote database queries to determine and deliver the <a href="../../javadoc/org/eclipse/emf/cdo/common/id/CDOID.html" title="Interface in org.eclipse.emf.cdo.common.id"><code>object IDs</code></a> that are involved in all changes
between two different <a href="../../javadoc/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="Interface in org.eclipse.emf.cdo.common.branch"><code>CDOBranchPoints</code></a>. The response times depend on the implementation of the <a href="../../javadoc/org/eclipse/emf/cdo/server/IStore.html" title="Interface in org.eclipse.emf.cdo.server"><code>backend storage</code></a>.
The response time of the default implementation, the DBStore, scales more
with the sizes of the stored meta models (i.e., the number of concrete <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EClass.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EClasses</code></a>) than with the sizes of the stored models
(i.e., the number of <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EObject.html" target="_blank" title="Interface in org.eclipse.emf.ecore"><code>EObjects</code></a>).
<p align="right">
<a href="Doc08_Collaborating.html" title="Backward to Collaborating in Real-Time"><img src="../../images/backward.png" border="0"></a>&nbsp;<a href="../operators/index.html" title="Forward to Operator's Guide"><img src="../../images/forward.png" border="0"></a></p>
<!-- <div class="help_breadcrumbs breadcrumbs_bottom"><a href="../Overview.html" title="CDO Model Repository Documentation">CDO Model Repository Documentation</a> > <a href="index.html" title="Category in CDO Model Repository Documentation">User's Guide</a></div> -->
<div class="copyright">Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.<br>All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html</div>
</body>
</html>