Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 440

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

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>GenericReflector</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>GenericReflector</h1>

<p>Db4o uses reflection internally for persisting and instantiating user objects. Reflection helps db4o to manage classes in a general way while saving. It also makes possible instantiation of user objects using class name saved in the database file and class information from the JVM or .NET assembly. However db4o reflection API can also work on generic objects when a class information is not available.</p>
<p>Db4o uses GenericReflector as a wrapper around specific reflector (delegate). GenericReflector is set when an ObjectContainer is opened. All subsequent reflector calls are routed through this interface. </p>
<p>GenericReflector keeps list of known classes in memory. When the GenericReflector is called, it first checks its list of known classes. If the class cannot be found, the task is transferred to the delegate reflector. If the delegate fails as well, generic objects are created, which hold simulated "field values" in an array of objects.</p>
<p>Generic reflector makes possible the following usecases:</p>
<ul>
<li>  running a db4o server without deploying application classes;</li>
<li>running db4o on Java dialects without reflection (J2ME CLDC, MIDP);</li>
<li>easier access to stored objects where classes or fields are not available;</li>
<li>  running refactorings in the reflector;</li>
<li>  building interfaces to db4o from any programming language.</li>
</ul>
<p>One of the live usecases is ObjectManager, which uses GenericReflector to read C# objects from Java.</p></div>
    </div>
    <div id="footer">
					This revision (4) was last Modified 2006-11-13T19:16:02 by Tetyana.
				</div>
  </body>
</html>