Prototypes Class

Summary

creates prototype objects for classes.
Assembly
Db4objects.Db4o-2010.dll
Namespace
Db4objects.Db4o.Qlin
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["Prototypes"] class Type type-node

Syntax

public class Prototypes

Remarks

creates prototype objects for classes. Each field on prototype objects is set to a newly created object or primitive that can be identified either by it's identity or by an int ID that is generated by the system. Creation of fields is recursed to the depth specified in the constructor.

Allows analyzing expressions called on prototype objects to find the underlying field that delivers the return value of the expression. Passed expressions should not have side effects on objects, otherwise the "prototype world" will no longer work.

We plan to supply an ImmutableFieldClassLoader to instrument the code to throw on every modification. This ClassLoader could also supply information about all the method calls involved.

For now our approach only works if expressions are directly backed by a single field.

We were inspired for this approach when we saw that Thomas Mueller managed to map expressions to fields for his JaQu query interface, Kudos! http://www.h2database.com/html/jaqu.html

We took the idea a bit further and made it work for all primitives except for boolean and we plan to also get deeper expressions, collections and interfaces working nicely.

Constructors

Methods

Name Value Summary
BackingFieldPath(IReflectClass, Object) IEnumerator
analyzes the passed expression and tries to find the path to the backing field that is accessed.
BackingFieldPath(string, Object) IEnumerator
analyzes the passed expression and tries to find the path to the backing field that is accessed.
BackingFieldPath(Type, Object) IEnumerator
analyzes the passed expression and tries to find the path to the backing field that is accessed.
DefaultReflector() IReflector
static
PrototypeForClass(Type) Object
returns a prototype object for a specific class.
Reflector() IReflector