Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1249

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Activation strategies</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Activation strategies</h1><div id="TOC"><div id="TOCinner"><span class="TOCtitle">Contents</span><div class="TOCcontents"><ul><li><a href ="#Advantage">Advantage</a></li><li><a href ="#Effect">Effect</a></li><li><a href ="#Alternate strategies">Alternate strategies</a></li></ul></li></ul></div></div></div>

<span name="cs_wiki_filter" csw_filters="net"><p>.NET:&nbsp; <br></p>
<p><code>configuration.ActivationDepth(activationDepth)</code></p>
</span>
<a name="Advantage"></a><h2>Advantage</h2>
<p>Db4o default activation depth is 5. This setting gives you control over activation depth level depending on your application requirements.</p>
<a name="Effect"></a><h2>Effect</h2>
<p>The two extremes:</p>
<ul>
<li>activationDepth = maximum integer value - will pop the whole object graph into the memory on every retrieved object. Can be a reasonable solution for shallow objects' design. No need to bother about manual activation;</li>
<li>activationDepth = 0 - will reduce memory consumption to the lowest level though leaving all the activation logic for your code.</li></ul>

<a name="Alternate strategies"></a><h2>Alternate strategies</h2>
<p>If your object is not fully activated due to the default configuration settings you can activate it manually:</p>

<span name="cs_wiki_filter" csw_filters="net">
<p>.NET: <code>IObjectContainer#Activate(object,depth)</code></p>
</span>
<p>or use specific object settings:</p>

<span name="cs_wiki_filter" csw_filters="net">
<p>.NET:</p>
<p><code>configuration.ObjectClass("yourClass").MinimumActivationDepth(minimumDepth)</code><br><code>configuration.ObjectClass("yourClass").MaximumActivationDepth(maximumDepth)</code><br><code>configuration.ObjectClass("yourClass").CascadeOnActivate (bool)</code><br><code>configuration.ObjectClass("yourClass").ObjectField("field").CascadeOnActivate(bool)</code></p>
</span>
<p>For more information on activation strategies see <a href="../../object_lifecycle/activation.html" class="wikiLink">Activation chapter</a>.</p></div>
    </div>
    <div id="footer">
					This revision (10) was last Modified 2007-05-07T16:34:31 by Tetyana.
				</div>
  </body>
</html>