Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.doc/help/concepts/object_identity.html')
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/help/concepts/object_identity.html75
1 files changed, 55 insertions, 20 deletions
diff --git a/plugins/org.eclipse.emf.cdo.doc/help/concepts/object_identity.html b/plugins/org.eclipse.emf.cdo.doc/help/concepts/object_identity.html
index 57708864b2..b782c247d2 100644
--- a/plugins/org.eclipse.emf.cdo.doc/help/concepts/object_identity.html
+++ b/plugins/org.eclipse.emf.cdo.doc/help/concepts/object_identity.html
@@ -1,47 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
-<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
+<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="concept" name="DC.Type" />
<meta name="DC.Title" content="Object Identity" />
-<meta name="abstract" content="Represents some real concept." />
-<meta name="description" content="Represents some real concept." />
+<meta name="abstract" content="CDOIDs are technical identifiers for CDOObjects." />
+<meta name="description" content="CDOIDs are technical identifiers for CDOObjects." />
<meta scheme="URI" name="DC.Relation" content="../concepts/objects.html" />
<meta scheme="URI" name="DC.Relation" content="../concepts/cdoid_factories.html" />
<meta scheme="URI" name="DC.Relation" content="../concepts/cdoid_class_loaders.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="object_identity" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
-<link href="..\commonltr.css" type="text/css" rel="stylesheet" />
+<link href="../commonltr.css" type="text/css" rel="stylesheet" />
<title>Object Identity</title>
</head>
<body id="object_identity"><a name="object_identity"><!-- --></a>
- <h1 class="topictitle1">Object Identity</h1>
+ <h1 class="topictitle1">Object Identity</h1>
-
-
-
- <div><p>Represents some real concept.</p>
+
+
+ <div><p>CDOIDs are technical identifiers for CDOObjects.</p>
- <div class="section"><h2 class="sectiontitle">A certain aspect of this concept</h2>
-
- <p>A tool box contains many compartments for organizing tools and hardware. Keep the tool box handy for all sorts of jobs around the
- house.</p>
+ <div class="section"><h2 class="sectiontitle">Lifecycle of CDOIDs</h2>
+
+ <p>Objects are always initially created at the client side by pulling them from an EFactory. CDOObjects are in state TRANSIENT at this time and do not have a CDOID.</p>
- </div>
+ <p>As soon as the object is attached to a CDOTransaction (by making it contained by an existing resource or object, that is already persistent) the state is changed to NEW and a temporary CDOID is assigned to it. Temporary CDOIDs are internally integer values that are unique only in the scope of this CDOTransaction (more exact: in the scope of the next commit operation to happen). Temporary CDOIDs can be cast to CDOIDTemp and their isTemporary() method returns true.</p>
- <div class="section"><h2 class="sectiontitle">Another aspect of this concept</h2>
-
- <p>A tool box contains many compartments for organizing tools and hardware. Keep the tool box handy for all sorts of jobs around the
- house.</p>
+ <p>When the CDOTransaction is committed the NEW objects are sent to the repository. Before they are persisted by the repository (more exact: by the store of the repository) the temporary CDOIDs are replaced by permanent ones which are unique in the scope of the whole repository. As part of this ID mapping all references to these objects are adjusted to the newly assigned, permanent CDOIDs. Permanent CDOIDs can be cast to CDOIDObject and their isTemporary() method returns false.</p>
- </div>
+ <p>Finally the mappings from temporary to permanent CDOIDs is sent back to the client where the permanent CDOIDs are assigned to the NEW objects and all references to them are adjusted accordingly. The state of all objects in a CDOTransactionis CLEAN after a successful commit operation.</p>
- </div>
+ </div>
+
+ <div class="section"><h2 class="sectiontitle">Class loading of CDOIDs</h2>
+
+ <div class="p">It is the responsibility of the store in the repository to create and assign permanent CDOIDs to NEW objects. The store is allowed to utilize whatever implementation of the CDOID interface seems appropriate for a given back-end. This may include code that is not present on the client side. Such situations are automatically detected by the client when a new CDOSession is opened to the repository and one or more Java archives are downloaded and cached on the client side. These JARs may contain:<br /><ol>
+ <li>The implementation code of the CDOIDs for the particular back-end type.</li>
+
+ <li>A factory class to produce instances of these CDOIDs.</li>
+
+ <li>Optimized serialization/deserialization code</li>
+
+ <li>Optionally any code that is needed to make the above work.</li>
+
+ </ol>
+</div>
+
+ <p>If a store implementation deals with CDOID implementations unknown to the framework, then each CDOSession to this repository maintains a separate instance of a ClassLoader for the instances of these CDOIDs. As a consequence it may not be possible to even compare CDOID instances that stem from different CDOSessions!</p>
+
+ <p>If a store implementation uses one of the default CDOID implementations, like CDOIDLongImpl, all instances of them are created by the normal framework ClassLoader. In this case store implementors may choose the abstract LongIDStore class as a base class for their custom store implementation.</p>
+
+ </div>
+
+ <div class="section"><h2 class="sectiontitle">Types of CDOIDs in References</h2>
+
+ <div class="p">There are four different types of CDOIDs depending on the type of the referenced object and the persistence infrastructure the referenced object is contained in:<br /><ol>
+ <li>CDOID.NULL is a special value that can be used as a reference target but not as the CDOID of CDOObjects.</li>
+
+ <li>Object IDs are the CDOIDs for references to normal objects (i.e. not meta objects, see below) that are managed by the same CDOView as the referencing object. They are also known as internal CDOIDs to separate them from external CDOIDs (see below).</li>
+
+ <li>Meta IDs are special CDOIDs used to reference instances of EModelElements stored in the meta section of the model repository. They are rarely used but they allow your business objects to refer to their own (or other) definitions.</li>
+
+ <li>External IDs are used to reference any objects that are not managed by the same CDOView as the referencing object. These can be CDOObjects in different CDOViews or CDOObjects that are not managed by any CDOView at this time or simply non-CDO objects.</li>
+
+ </ol>
+</div>
+
+ <p>All CDOID types except CDOID.NULL support the difference between temporary and permanent values.</p>
+
+ </div>
+
+ </div>
<div>
<ul class="ullinks">

Back to the top