Index: anches/New Persistence Exploration/Persistence/Persistence/ArrayFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/ArrayFormatters.cs	(revision 1359)
+++ 	(revision )
@@ -1,96 +1,0 @@
-﻿using System.Collections;
-using System.Text;
-using HeuristicLab.Persistence.Interfaces;
-using System;
-
-namespace HeuristicLab.Persistence {
-
-
-  public abstract class NumberArray2XmlFormatter : IFormatter {
-
-    public abstract Type Type { get; }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    protected virtual string Separator { get { return ";"; } }
-    protected abstract string formatValue(object o);
-    protected abstract object parseValue(string o);
-
-    public object Serialize(object obj) {
-      Array a = (Array)obj;
-      StringBuilder sb = new StringBuilder();
-      sb.Append(a.Rank);
-      for (int i = 0; i < a.Rank; i++) {
-        sb.Append(Separator);
-        sb.Append(a.GetLength(i));
-      }
-      foreach (object o in a) {
-        sb.Append(Separator);
-        sb.Append(formatValue(o));
-      }
-      return sb.ToString();
-    }
-
-    public object DeSerialize(object o) {
-      IEnumerator values =
-        ((string)o)
-        .Split(new[] { Separator },
-        StringSplitOptions.RemoveEmptyEntries).GetEnumerator();
-      values.MoveNext();
-      int rank = int.Parse((string)values.Current);
-      int[] lengths = new int[rank];
-      for (int i = 0; i < rank; i++) {
-        values.MoveNext();
-        lengths[i] = int.Parse((string)values.Current);
-      }
-      Array a = Array.CreateInstance(this.Type.GetElementType(), lengths);
-      int[] positions = new int[rank];
-      while (values.MoveNext()) {
-        a.SetValue(parseValue((string)values.Current), positions);
-        positions[0] += 1;
-        for (int i = 0; i < rank - 1; i++) {
-          if (positions[i] >= lengths[i]) {
-            positions[i] = 0;
-            positions[i + 1] += 1;
-          } else {
-            break;
-          }
-        }
-      }
-      return a;
-    }
-  }
-
-
-  public class IntArray2XmlFormatter : NumberArray2XmlFormatter {
-    public override Type Type { get { return typeof(int[]); } }
-    protected override string formatValue(object o) { return o.ToString(); }
-    protected override object parseValue(string o) { return int.Parse(o); }
-  }
-
-
-  public class Int2DArray2XmlFormatter : IntArray2XmlFormatter {
-    public override Type Type { get { return typeof(int[,]); } }
-  }
-
-
-  public class Int3DArray2XmlFormatter : IntArray2XmlFormatter {
-    public override Type Type { get { return typeof(int[, ,]); } }
-  }
-
-
-  public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {
-    public override Type Type { get { return typeof(double[]); } }
-    protected override string formatValue(object o) { return ((double)o).ToString("r"); }
-    protected override object parseValue(string o) { return double.Parse(o); }
-  }
-
-
-  public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatter {
-    public override Type Type { get { return typeof(double[,]); } }
-  }
-
-
-  public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatter {
-    public override Type Type { get { return typeof(double[, ,]); } }
-  }
-  
-}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/DataMemberAccessor.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/DataMemberAccessor.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/DataMemberAccessor.cs	(revision 1360)
@@ -0,0 +1,71 @@
+﻿using System;
+using System.Reflection;
+using HeuristicLab.Persistence.Core;
+
+namespace HeuristicLab.Persistence {
+
+  public class DataMemberAccessor {
+
+    public delegate object Getter();
+    public delegate void Setter(object value);
+
+    public readonly Getter Get;
+    public readonly Setter Set;
+    public readonly string Name;
+    public readonly Type Type;
+    public readonly object DefaultValue;
+
+    public DataMemberAccessor(
+        MemberInfo memberInfo,
+        StorableAttribute autoStorableAttribute,
+        object obj) {
+      if (memberInfo.MemberType == MemberTypes.Field) {
+        FieldInfo fieldInfo = (FieldInfo)memberInfo;
+        Get = () => fieldInfo.GetValue(obj);
+        Set = value => fieldInfo.SetValue(obj, value);
+        Type = fieldInfo.FieldType;
+      } else if (memberInfo.MemberType == MemberTypes.Property) {
+        PropertyInfo propertyInfo = (PropertyInfo)memberInfo;
+        if (!propertyInfo.CanRead || !propertyInfo.CanWrite) {
+          throw new NotSupportedException(
+            "Storable properties must implement both a Get and a Set Accessor. ");
+        }
+        Get = () => propertyInfo.GetValue(obj, null);
+        Set = value => propertyInfo.SetValue(obj, value, null);
+        Type = propertyInfo.PropertyType;
+      } else {
+        throw new NotSupportedException(
+                "The Storable attribute can only be applied to fields and properties.");
+      }
+      Name = autoStorableAttribute.Name ?? memberInfo.Name;
+      DefaultValue = autoStorableAttribute.DefaultValue;
+    }
+
+    public DataMemberAccessor(
+        string name, Type type, object defaultValue,
+        Getter getter, Setter setter) {
+      Name = name;
+      Type = type;
+      DefaultValue = defaultValue;
+      Get = getter;
+      Set = setter;
+    }
+
+    public DataMemberAccessor(object o) {
+      Name = null;
+      Type = o.GetType();
+      DefaultValue = null;
+      Get = () => o;
+      Set = null;
+    }
+
+    public override string ToString() {
+      return String.Format("DataMember({0}, {1}, {2}, {3}, {4})",
+        Name,
+        Type == null ? "<null>" : Type.FullName,
+        DefaultValue ?? "<null>",
+        Get.Method, Set.Method);
+    }
+  }
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1360)
@@ -0,0 +1,189 @@
+﻿using System.Collections.Generic;
+using System;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Core {
+
+
+  struct ParentReference { }
+  delegate void Setter(object value);
+
+
+  interface IAccessibleObject {
+    object Obj { get; }
+    Setter GetSetter(string name);
+  }
+
+
+  class CustomObject : IAccessibleObject {
+
+    public object Obj { get; private set; }
+    public readonly List<object> customValues;
+
+    public CustomObject(object obj) {
+      Obj = obj;
+      customValues = new List<object>();
+    }
+
+    public void AddValue(object value) {
+      customValues.Add(value);
+    }
+
+    public Setter GetSetter(string name) {
+      int index = customValues.Count - 1;
+      return value => customValues[index] = value;
+    }
+  }
+
+
+  class CompositeObject : IAccessibleObject {
+
+    public object Obj { get; private set; }
+    public readonly Dictionary<string, DataMemberAccessor> accessorDict;
+
+    public CompositeObject(object obj, Dictionary<string, DataMemberAccessor> accessorDict) {
+      Obj = obj;
+      this.accessorDict = new Dictionary<string, DataMemberAccessor>();
+      foreach (KeyValuePair<string, DataMemberAccessor> pair in accessorDict) {
+        this.accessorDict.Add(
+          pair.Value.Name,
+          pair.Value);
+      }
+    }
+
+    public void SetValue(string name, object value) {
+      accessorDict[name].Set(value);
+      accessorDict.Remove(name);
+    }
+
+    public Setter GetSetter(string name) {
+      return value => accessorDict[name].Set(value);
+    }
+
+    public void PopulateDefaultValues() {
+      foreach (var pair in accessorDict) {
+        pair.Value.Set(pair.Value.DefaultValue);
+      }
+    }
+  }
+
+
+  public class DeSerializer {
+
+    private delegate void Handler(ISerializationToken token);
+    private delegate void Thunk();
+
+    private readonly Dictionary<int, object> id2obj;
+    private readonly Dictionary<Type, Handler> handlers;
+    private readonly Stack<IAccessibleObject> compositeStack;
+    private readonly Configuration configuration;
+    private readonly Dictionary<int, Type> typeIds;    
+    private List<Thunk> finalFixes;
+
+    public DeSerializer(
+      IEnumerable<KeyValuePair<string, int>> typeCache,
+      Configuration configuration) {
+      this.configuration = configuration;
+      id2obj = new Dictionary<int, object>();
+      compositeStack = new Stack<IAccessibleObject>();
+      handlers = new Dictionary<Type, Handler> {
+                     {typeof (BeginToken), CompositeStartHandler},
+                     {typeof (EndToken), CompositeEndHandler},
+                     {typeof (PrimitiveToken), PrimitiveHandler},
+                     {typeof (ReferenceToken), ReferenceHandler},
+                     {typeof (NullReferenceToken), NullHandler}
+                   };      
+      typeIds = new Dictionary<int, Type>();
+      foreach ( var pair in typeCache ) {
+        Type type = Type.GetType(pair.Key);
+        typeIds.Add(pair.Value, type);
+      }
+    }
+
+    public object DeSerialize(IEnumerable<ISerializationToken> tokens) {
+      finalFixes = new List<Thunk>();
+      foreach (ISerializationToken token in tokens) {
+        handlers[token.GetType()].Invoke(token);
+      }
+      foreach (Thunk fix in finalFixes) {
+        fix();
+      }
+      return compositeStack.Pop().Obj;
+    }
+
+    private void CompositeStartHandler(ISerializationToken token) {
+      BeginToken start = (BeginToken)token;
+      object instance;      
+      Type type = typeIds[(int)start.TypeId];
+      if (configuration.GetDecomposer(type) != null) {
+        instance = new ParentReference();
+        compositeStack.Push(new CustomObject(instance));        
+      } else {        
+        instance = Activator.CreateInstance(type, true);
+        Dictionary<string, DataMemberAccessor> accessorDict =
+          StorableAttribute.GetAutostorableAccessors(instance);
+        compositeStack.Push(new CompositeObject(instance, accessorDict));        
+      }
+      if ( start.Id != null )
+        id2obj.Add((int)start.Id, instance);
+    }
+
+    private void CompositeEndHandler(ISerializationToken token) {
+      EndToken end = (EndToken)token;
+      Type type = typeIds[(int)end.TypeId];
+      IDecomposer decomposer = configuration.GetDecomposer(type);
+      if (decomposer != null) {
+        CustomObject customObject = (CustomObject)compositeStack.Pop();
+        object deserializedObject =
+          decomposer.Compose(customObject.customValues, type);
+        if ( end.Id != null )
+          id2obj[(int)end.Id] = deserializedObject;        
+        SetValue(end.Name, deserializedObject);          
+      } else {
+        CompositeObject compositeObject = (CompositeObject)compositeStack.Pop();
+        compositeObject.PopulateDefaultValues();
+        SetValue(end.Name, compositeObject.Obj);
+      }
+    }
+
+    private void PrimitiveHandler(ISerializationToken token) {
+      PrimitiveToken primitive = (PrimitiveToken)token;
+      Type type = typeIds[(int)primitive.TypeId];
+      object value = configuration
+        .GetFormatter(type)
+        .Parse(primitive.SerialData);
+      if ( ! value.GetType().IsValueType )
+        id2obj[(int)primitive.Id] = value;
+      SetValue(primitive.Name, value);
+    }
+
+    private void ReferenceHandler(ISerializationToken token) {
+      ReferenceToken reference = (ReferenceToken)token;
+      object referredObject = id2obj[reference.Id];
+      SetValue(reference.Name, id2obj[reference.Id]);
+      if (referredObject is ParentReference) {
+        Setter set = compositeStack.Peek().GetSetter(reference.Name);        
+        int id = reference.Id;
+        finalFixes.Add(() => set(id2obj[id]));
+      } 
+    }
+
+    private void NullHandler(ISerializationToken token) {
+      NullReferenceToken nil = (NullReferenceToken)token;
+      SetValue(nil.Name, null);
+    }
+
+    private void SetValue(string name, object value) {
+      if (compositeStack.Count == 0) {
+        compositeStack.Push(new CompositeObject(value, new Dictionary<string, DataMemberAccessor>()));
+      } else {
+        object accessibleObject = compositeStack.Peek();
+        if (accessibleObject is CompositeObject) {
+          ((CompositeObject)accessibleObject).SetValue(name, value);
+        } else if (accessibleObject is CustomObject) {
+          ((CustomObject)accessibleObject).AddValue(value);
+        }
+      }
+    }
+  }
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/PersistenceConfiguration.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/PersistenceConfiguration.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/PersistenceConfiguration.cs	(revision 1360)
@@ -0,0 +1,114 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Reflection;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence {
+
+  public class Configuration {
+
+    private readonly Dictionary<Type, IFormatter> formatters;
+    private readonly List<IDecomposer> decomposers;
+    private readonly Dictionary<Type, IDecomposer> decomposerCache;
+    public readonly IFormat Format;
+
+    public Configuration(Dictionary<Type, IFormatter> formatters, IEnumerable<IDecomposer> decomposers) {      
+      this.formatters = new Dictionary<Type, IFormatter>();
+      foreach ( var pair in formatters ) {
+        if (Format == null) {
+          Format = pair.Value.Format;
+        } else if (pair.Value.Format != Format ) {
+          throw new ArgumentException("All formatters must have the same IFormat.");
+        }
+        this.formatters.Add(pair.Key, pair.Value);
+      }
+      this.decomposers = new List<IDecomposer>(decomposers);
+      decomposerCache = new Dictionary<Type, IDecomposer>();      
+    }    
+
+    public IFormatter GetFormatter(Type type) {
+      IFormatter formatter;
+      formatters.TryGetValue(type, out formatter);
+      return formatter;
+    }
+
+    public IDecomposer GetDecomposer(Type type) {
+      IDecomposer decomposer;
+      decomposerCache.TryGetValue(type, out decomposer);
+      if (decomposer != null)
+        return decomposer;
+      foreach (IDecomposer d in decomposers) {
+        if (d.CanDecompose(type)) {
+          decomposerCache.Add(type, d);
+          return d;
+        }
+      }
+      return null;
+    }
+    
+  }
+
+  public class ConfigurationService {
+
+    private readonly Dictionary<IFormat, List<IFormatter>> formatters;
+    private readonly List<IDecomposer> decomposers;
+    
+    private static ConfigurationService instance;
+    public static ConfigurationService Instance {
+      get {
+        if (instance == null) {
+          instance = new ConfigurationService();
+        }
+        return instance;
+      }
+    }
+
+    public ConfigurationService() {
+      formatters = new Dictionary<IFormat, List<IFormatter>>();
+      decomposers = new List<IDecomposer>();
+      Reset();
+    }
+
+    public void Reset() {
+      Assembly defaultAssembly = Assembly.GetExecutingAssembly();
+      DiscoverFrom(defaultAssembly);
+      foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
+        if ( a != defaultAssembly )
+          DiscoverFrom(a);
+    }
+
+    protected void DiscoverFrom(Assembly a) {
+      foreach (Type t in a.GetTypes()) {
+        if (t.GetInterface(typeof (IFormatter).FullName) != null) {
+          try {
+            IFormatter formatter = (IFormatter) Activator.CreateInstance(t, true);
+            if ( ! formatters.ContainsKey(formatter.Format) ) {
+              formatters.Add(formatter.Format, new List<IFormatter>());
+            }
+            formatters[formatter.Format].Add(formatter);
+          } catch (MissingMethodException) {
+            Console.WriteLine("WARNING: Could not instantiate {0}", t.FullName);
+          }          
+        }
+        if (t.GetInterface(typeof (IDecomposer).FullName) != null) {
+          try {
+            decomposers.Add((IDecomposer) Activator.CreateInstance(t, true));
+          } catch (MissingMethodException) {
+            Console.WriteLine("WARNING: Could not instantiate {0}", t.FullName);
+          }
+        }
+      }
+    }
+
+    public Configuration GetDefaultConfig(IFormat format) {
+      Dictionary<Type, IFormatter> formatterConfig = new Dictionary<Type, IFormatter>();
+      foreach ( IFormatter f in formatters[format] ) {
+        if ( ! formatterConfig.ContainsKey(f.Type) )
+          formatterConfig.Add(f.Type, f);
+      }
+      return new Configuration(formatterConfig, decomposers);
+    }
+
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs	(revision 1360)
@@ -0,0 +1,115 @@
+﻿using System.Collections.Generic;
+using System.Collections;
+using System;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.Core {
+
+  public class Serializer : IEnumerable<ISerializationToken> {
+
+    private readonly object obj;
+    private readonly string rootName;
+    private readonly Dictionary<object, int> obj2id;
+    private readonly Dictionary<Type, int> typeCache;
+    private readonly Configuration configuration;
+
+    public Dictionary<string, int> TypeCache {
+      get {        
+        Dictionary<string, int> result = new Dictionary<string, int>();
+        foreach ( var pair in typeCache )
+          result.Add(pair.Key.AssemblyQualifiedName, pair.Value);
+        return result;                                     
+      }
+    }
+
+    public Serializer(object obj, Configuration configuration) :        
+      this(obj, configuration, "ROOT") { }
+
+    public Serializer(object obj, Configuration configuration, string rootName) {
+      this.obj = obj;
+      this.rootName = rootName;
+      this.configuration = configuration;      
+      obj2id = new Dictionary<object, int> {{new object(), 0}};
+      typeCache = new Dictionary<Type, int>();
+    }
+
+    IEnumerator IEnumerable.GetEnumerator() {
+      return GetEnumerator();
+    }
+
+    public IEnumerator<ISerializationToken> GetEnumerator() {
+      DataMemberAccessor rootAccessor = new DataMemberAccessor(
+        rootName, obj.GetType(), null, () => obj, null);
+      IEnumerator<ISerializationToken> iterator = Serialize(rootAccessor);
+      while (iterator.MoveNext())
+        yield return iterator.Current;      
+    }
+
+    
+    private IEnumerator<ISerializationToken> Serialize(DataMemberAccessor accessor) {
+      object value = accessor.Get();
+      if (value == null)
+        return NullReferenceEnumeration(accessor.Name);
+      if (obj2id.ContainsKey(value))
+        return ReferenceTokenEnumeration(accessor.Name, obj2id[value]);              
+      if ( ! typeCache.ContainsKey(value.GetType()))
+        typeCache.Add(value.GetType(), typeCache.Count);
+      int typeId = typeCache[value.GetType()];
+      int? id = null;
+      if ( ! value.GetType().IsValueType) {
+        id = obj2id.Count;
+        obj2id.Add(value, (int)id);
+      }
+      IFormatter formatter = configuration.GetFormatter(value.GetType());
+      if (formatter != null)
+        return PrimitiveEnumeration(accessor.Name, typeId, formatter.DoFormat(value), id);
+      IDecomposer decomposer = configuration.GetDecomposer(value.GetType()); 
+      if (decomposer != null)
+        return CompositeEnumeration(accessor.Name, decomposer.DeCompose(value), id, typeId);            
+      return StorableEnumeration(accessor.Name, value, id, typeId);
+    }
+
+    private IEnumerator<ISerializationToken> NullReferenceEnumeration(string name) {
+      yield return new NullReferenceToken(name);
+    }
+
+    private IEnumerator<ISerializationToken> ReferenceTokenEnumeration(string name, int id) {
+      yield return new ReferenceToken(name, id);
+    }
+
+    private IEnumerator<ISerializationToken> PrimitiveEnumeration(string name, int typeId, object serializedValue, int? id) {
+      yield return new PrimitiveToken(name, typeId, serializedValue, id);
+    }
+
+    private IEnumerator<ISerializationToken> CompositeEnumeration(string name, IEnumerable values, int? id, int typeId) {
+      yield return new BeginToken(name, typeId, id);      
+        foreach (object o in values) {
+          IEnumerator<ISerializationToken> iterator = Serialize(new DataMemberAccessor(o));
+          while (iterator.MoveNext())
+            yield return iterator.Current;
+        }
+      yield return new EndToken(name, typeId, id);        
+    }
+
+    private IEnumerator<ISerializationToken> StorableEnumeration(string name, object value, int? id, int typeId) {            
+      yield return new BeginToken(name, typeId, id);
+      int nSubComponents = 0;
+      foreach (KeyValuePair<string, DataMemberAccessor> mapping in
+        StorableAttribute.GetAutostorableAccessors(value)) {
+        nSubComponents += 1;
+        IEnumerator<ISerializationToken> iterator = Serialize(mapping.Value);
+        while (iterator.MoveNext()) {
+          yield return iterator.Current;
+        }
+      }
+      if (nSubComponents == 0) {
+        throw new ApplicationException(String.Format(
+                                         "Composite value of type \"{0}\" contains no subcomponents",
+                                         value.GetType().FullName));
+      }
+      yield return new EndToken(name, typeId, id);
+    }
+  }
+
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/StorableAttribute.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/StorableAttribute.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/StorableAttribute.cs	(revision 1360)
@@ -0,0 +1,51 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace HeuristicLab.Persistence.Core {
+
+  [AttributeUsage(
+    AttributeTargets.Field | AttributeTargets.Property,
+    AllowMultiple=false,
+    Inherited=false)]
+  public class StorableAttribute : Attribute {
+
+    public string Name { get; set; }
+    public object DefaultValue { get; set; }
+
+    private const BindingFlags instanceMembers =
+      BindingFlags.Instance |
+      BindingFlags.Public |
+      BindingFlags.NonPublic;
+    
+    public static IEnumerable<KeyValuePair<StorableAttribute, MemberInfo>> GetStorableMembers(Type type) {
+      return GetStorableMembers(type, true);      
+    }
+
+    public static IEnumerable<KeyValuePair<StorableAttribute, MemberInfo>>
+        GetStorableMembers(Type type, bool inherited) {
+      if (type.BaseType != null)
+        foreach ( var pair in GetStorableMembers(type.BaseType) )
+          yield return pair;
+      foreach (MemberInfo memberInfo in type.GetMembers(instanceMembers)) {
+        foreach (object attribute in memberInfo.GetCustomAttributes(false)) {          
+          StorableAttribute storableAttribute =
+            attribute as StorableAttribute;
+          if (storableAttribute != null) {
+            yield return new KeyValuePair<StorableAttribute, MemberInfo>(storableAttribute, memberInfo);            
+          }
+        }
+      }      
+    }
+
+    public static Dictionary<string, DataMemberAccessor> GetAutostorableAccessors(object obj) {
+      Dictionary<string, DataMemberAccessor> storableAccessors =
+        new Dictionary<string, DataMemberAccessor>();
+      foreach (KeyValuePair<StorableAttribute, MemberInfo> pair in GetStorableMembers(obj.GetType())) {
+        storableAccessors.Add(pair.Value.Name,
+          new DataMemberAccessor(pair.Value, pair.Key, obj));
+      }            
+      return storableAccessors;
+    }    
+  }
+}
Index: anches/New Persistence Exploration/Persistence/Persistence/DeSerializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/DeSerializer.cs	(revision 1359)
+++ 	(revision )
@@ -1,189 +1,0 @@
-﻿using System.Collections.Generic;
-using System;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-
-  struct ParentReference { }
-  delegate void Setter(object value);
-
-
-  interface IAccessibleObject {
-    object Obj { get; }
-    Setter GetSetter(string name);
-  }
-
-
-  class CustomObject : IAccessibleObject {
-
-    public object Obj { get; private set; }
-    public readonly List<object> customValues;
-
-    public CustomObject(object obj) {
-      Obj = obj;
-      customValues = new List<object>();
-    }
-
-    public void AddValue(object value) {
-      customValues.Add(value);
-    }
-
-    public Setter GetSetter(string name) {
-      int index = customValues.Count - 1;
-      return value => customValues[index] = value;
-    }
-  }
-
-
-  class CompositeObject : IAccessibleObject {
-
-    public object Obj { get; private set; }
-    public readonly Dictionary<string, DataMemberAccessor> accessorDict;
-
-    public CompositeObject(object obj, Dictionary<string, DataMemberAccessor> accessorDict) {
-      Obj = obj;
-      this.accessorDict = new Dictionary<string, DataMemberAccessor>();
-      foreach (KeyValuePair<string, DataMemberAccessor> pair in accessorDict) {
-        this.accessorDict.Add(
-          pair.Value.Name,
-          pair.Value);
-      }
-    }
-
-    public void SetValue(string name, object value) {
-      accessorDict[name].Set(value);
-      accessorDict.Remove(name);
-    }
-
-    public Setter GetSetter(string name) {
-      return value => accessorDict[name].Set(value);
-    }
-
-    public void PopulateDefaultValues() {
-      foreach (var pair in accessorDict) {
-        pair.Value.Set(pair.Value.DefaultValue);
-      }
-    }
-  }
-
-
-  public class DeSerializer {
-
-    private delegate void Handler(ISerializationToken token);
-    private delegate void Thunk();
-
-    private readonly Dictionary<int, object> id2obj;
-    private readonly Dictionary<Type, Handler> handlers;
-    private readonly Stack<IAccessibleObject> compositeStack;
-    private readonly Configuration configuration;
-    private readonly Dictionary<int, Type> typeIds;    
-    private List<Thunk> finalFixes;
-
-    public DeSerializer(
-      IEnumerable<KeyValuePair<string, int>> typeCache,
-      Configuration configuration) {
-      this.configuration = configuration;
-      id2obj = new Dictionary<int, object>();
-      compositeStack = new Stack<IAccessibleObject>();
-      handlers = new Dictionary<Type, Handler> {
-                     {typeof (BeginToken), CompositeStartHandler},
-                     {typeof (EndToken), CompositeEndHandler},
-                     {typeof (PrimitiveToken), PrimitiveHandler},
-                     {typeof (ReferenceToken), ReferenceHandler},
-                     {typeof (NullReferenceToken), NullHandler}
-                   };      
-      typeIds = new Dictionary<int, Type>();
-      foreach ( var pair in typeCache ) {
-        Type type = Type.GetType(pair.Key);
-        typeIds.Add(pair.Value, type);
-      }
-    }
-
-    public object DeSerialize(IEnumerable<ISerializationToken> tokens) {
-      finalFixes = new List<Thunk>();
-      foreach (ISerializationToken token in tokens) {
-        handlers[token.GetType()].Invoke(token);
-      }
-      foreach (Thunk fix in finalFixes) {
-        fix();
-      }
-      return compositeStack.Pop().Obj;
-    }
-
-    private void CompositeStartHandler(ISerializationToken token) {
-      BeginToken start = (BeginToken)token;
-      object instance;      
-      Type type = typeIds[(int)start.TypeId];
-      if (configuration.GetDecomposer(type) != null) {
-        instance = new ParentReference();
-        compositeStack.Push(new CustomObject(instance));        
-      } else {        
-        instance = Activator.CreateInstance(type, true);
-        Dictionary<string, DataMemberAccessor> accessorDict =
-          StorableAttribute.GetAutostorableAccessors(instance);
-        compositeStack.Push(new CompositeObject(instance, accessorDict));        
-      }
-      if ( start.Id != null )
-        id2obj.Add((int)start.Id, instance);
-    }
-
-    private void CompositeEndHandler(ISerializationToken token) {
-      EndToken end = (EndToken)token;
-      Type type = typeIds[(int)end.TypeId];
-      IDecomposer decomposer = configuration.GetDecomposer(type);
-      if (decomposer != null) {
-        CustomObject customObject = (CustomObject)compositeStack.Pop();
-        object deserializedObject =
-          decomposer.DeSerialize(customObject.customValues, type);
-        if ( end.Id != null )
-          id2obj[(int)end.Id] = deserializedObject;        
-        SetValue(end.Name, deserializedObject);          
-      } else {
-        CompositeObject compositeObject = (CompositeObject)compositeStack.Pop();
-        compositeObject.PopulateDefaultValues();
-        SetValue(end.Name, compositeObject.Obj);
-      }
-    }
-
-    private void PrimitiveHandler(ISerializationToken token) {
-      PrimitiveToken primitive = (PrimitiveToken)token;
-      Type type = typeIds[(int)primitive.TypeId];
-      object value = configuration
-        .GetFormatter(type)
-        .DeSerialize(primitive.SerialData);
-      if ( ! value.GetType().IsValueType )
-        id2obj[(int)primitive.Id] = value;
-      SetValue(primitive.Name, value);
-    }
-
-    private void ReferenceHandler(ISerializationToken token) {
-      ReferenceToken reference = (ReferenceToken)token;
-      object referredObject = id2obj[reference.Id];
-      SetValue(reference.Name, id2obj[reference.Id]);
-      if (referredObject is ParentReference) {
-        Setter set = compositeStack.Peek().GetSetter(reference.Name);        
-        int id = reference.Id;
-        finalFixes.Add(() => set(id2obj[id]));
-      } 
-    }
-
-    private void NullHandler(ISerializationToken token) {
-      NullReferenceToken nil = (NullReferenceToken)token;
-      SetValue(nil.Name, null);
-    }
-
-    private void SetValue(string name, object value) {
-      if (compositeStack.Count == 0) {
-        compositeStack.Push(new CompositeObject(value, new Dictionary<string, DataMemberAccessor>()));
-      } else {
-        object accessibleObject = compositeStack.Peek();
-        if (accessibleObject is CompositeObject) {
-          ((CompositeObject)accessibleObject).SetValue(name, value);
-        } else if (accessibleObject is CustomObject) {
-          ((CustomObject)accessibleObject).AddValue(value);
-        }
-      }
-    }
-  }
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/Decomposers.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Decomposers.cs	(revision 1359)
+++ 	(revision )
@@ -1,129 +1,0 @@
-﻿using System;
-using System.Collections;
-using System.Reflection;
-using System.Collections.Generic;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-  
-  public class EnumerableDecomposer : IDecomposer {
-
-    public bool CanSerialize(Type type) {
-      return
-        type.GetInterface("IEnumerable") != null &&
-        type.GetMethod("Add") != null &&
-        type.GetMethod("Add").GetParameters().Length == 1 &&
-        type.GetConstructor(
-          BindingFlags.Public |
-          BindingFlags.NonPublic |
-          BindingFlags.Instance,
-          null, Type.EmptyTypes, null) != null;        
-    }    
-
-    public IEnumerable Serialize(object obj) {
-      return (IEnumerable)obj;
-    }
-
-    public object DeSerialize(IEnumerable objects, Type type) {
-      object instance = Activator.CreateInstance(type, true);
-      MethodInfo addMethod = type.GetMethod("Add");
-      foreach (object o in objects) {
-        addMethod.Invoke(instance, new[] {o});        
-      }
-      return instance;
-    }
-
-  }
-
-
-  public class ArrayDecomposer : IDecomposer {
-
-    public bool CanSerialize(Type type) {
-      return type.IsArray || type == typeof(Array);
-    }
-
-    public IEnumerable Serialize(object array) {
-      Array a = (Array)array;
-      yield return a.Rank;
-      for (int i = 0; i < a.Rank; i++) {
-        yield return a.GetLength(i);
-      }
-      foreach (object o in (Array)array) {
-        yield return o;
-      }
-    }
-
-    public object DeSerialize(IEnumerable elements, Type t) {
-      IEnumerator e = elements.GetEnumerator();
-      e.MoveNext();
-      int rank = (int)e.Current;
-      int[] lengths = new int[rank];
-      for (int i = 0; i < rank; i++) {
-        e.MoveNext();
-        lengths[i] = (int)e.Current;
-      }
-      Array a = Array.CreateInstance(t.GetElementType(), lengths);      
-      int[] positions = new int[rank];
-      while (e.MoveNext()) {
-        a.SetValue(e.Current, positions);
-        positions[0] += 1;
-        for (int i = 0; i < rank-1; i++) {
-          if (positions[i] >= lengths[i]) {
-            positions[i] = 0;
-            positions[i + 1] += 1;
-          } else {
-            break;
-          }
-        }
-      }
-      return a;
-    }
-  }
-
-
-  public class KeyValuePairDecomposer : IDecomposer {    
-
-    public bool CanSerialize(Type type) {
-      return type.IsGenericType &&
-             type.GetGenericTypeDefinition() == 
-             typeof (KeyValuePair<int, int>).GetGenericTypeDefinition();
-    }
-
-    public IEnumerable Serialize(object o) {      
-      Type t = o.GetType();
-      yield return t.GetProperty("Key").GetValue(o, null);
-      yield return t.GetProperty("Value").GetValue(o, null);
-    }
-
-    public object DeSerialize(IEnumerable o, Type t) {      
-      return Activator.CreateInstance(t,
-        new List<object>((IEnumerable<object>)o).ToArray());
-    }    
-  }
-
-
-  public class DictionaryDecomposer : IDecomposer {
-    public bool CanSerialize(Type type) {
-      return type.GetInterface("IDictionary") != null;        
-    }
-    public IEnumerable Serialize(object o) {
-      IDictionary dict = (IDictionary)o;      
-      foreach ( DictionaryEntry entry in dict) {
-        yield return entry.Key;
-        yield return entry.Value;
-      }
-    }
-    public object DeSerialize(IEnumerable o, Type t) {
-      IDictionary dict = (IDictionary)Activator.CreateInstance(t, true);
-      IEnumerator iter = o.GetEnumerator();
-      while (iter.MoveNext()) {
-        object key = iter.Current;
-        iter.MoveNext();
-        object value = iter.Current;
-        dict.Add(key, value);
-      }
-      return dict;
-    }
-  }
-
-}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers.cs	(revision 1360)
@@ -0,0 +1,129 @@
+﻿using System;
+using System.Collections;
+using System.Reflection;
+using System.Collections.Generic;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence {
+  
+  public class EnumerableDecomposer : IDecomposer {
+
+    public bool CanDecompose(Type type) {
+      return
+        type.GetInterface("IEnumerable") != null &&
+        type.GetMethod("Add") != null &&
+        type.GetMethod("Add").GetParameters().Length == 1 &&
+        type.GetConstructor(
+          BindingFlags.Public |
+          BindingFlags.NonPublic |
+          BindingFlags.Instance,
+          null, Type.EmptyTypes, null) != null;        
+    }    
+
+    public IEnumerable DeCompose(object obj) {
+      return (IEnumerable)obj;
+    }
+
+    public object Compose(IEnumerable objects, Type type) {
+      object instance = Activator.CreateInstance(type, true);
+      MethodInfo addMethod = type.GetMethod("Add");
+      foreach (object o in objects) {
+        addMethod.Invoke(instance, new[] {o});        
+      }
+      return instance;
+    }
+
+  }
+
+
+  public class ArrayDecomposer : IDecomposer {
+
+    public bool CanDecompose(Type type) {
+      return type.IsArray || type == typeof(Array);
+    }
+
+    public IEnumerable DeCompose(object array) {
+      Array a = (Array)array;
+      yield return a.Rank;
+      for (int i = 0; i < a.Rank; i++) {
+        yield return a.GetLength(i);
+      }
+      foreach (object o in (Array)array) {
+        yield return o;
+      }
+    }
+
+    public object Compose(IEnumerable elements, Type t) {
+      IEnumerator e = elements.GetEnumerator();
+      e.MoveNext();
+      int rank = (int)e.Current;
+      int[] lengths = new int[rank];
+      for (int i = 0; i < rank; i++) {
+        e.MoveNext();
+        lengths[i] = (int)e.Current;
+      }
+      Array a = Array.CreateInstance(t.GetElementType(), lengths);      
+      int[] positions = new int[rank];
+      while (e.MoveNext()) {
+        a.SetValue(e.Current, positions);
+        positions[0] += 1;
+        for (int i = 0; i < rank-1; i++) {
+          if (positions[i] >= lengths[i]) {
+            positions[i] = 0;
+            positions[i + 1] += 1;
+          } else {
+            break;
+          }
+        }
+      }
+      return a;
+    }
+  }
+
+
+  public class KeyValuePairDecomposer : IDecomposer {    
+
+    public bool CanDecompose(Type type) {
+      return type.IsGenericType &&
+             type.GetGenericTypeDefinition() == 
+             typeof (KeyValuePair<int, int>).GetGenericTypeDefinition();
+    }
+
+    public IEnumerable DeCompose(object o) {      
+      Type t = o.GetType();
+      yield return t.GetProperty("Key").GetValue(o, null);
+      yield return t.GetProperty("Value").GetValue(o, null);
+    }
+
+    public object Compose(IEnumerable o, Type t) {      
+      return Activator.CreateInstance(t,
+        new List<object>((IEnumerable<object>)o).ToArray());
+    }    
+  }
+
+
+  public class DictionaryDecomposer : IDecomposer {
+    public bool CanDecompose(Type type) {
+      return type.GetInterface("IDictionary") != null;        
+    }
+    public IEnumerable DeCompose(object o) {
+      IDictionary dict = (IDictionary)o;      
+      foreach ( DictionaryEntry entry in dict) {
+        yield return entry.Key;
+        yield return entry.Value;
+      }
+    }
+    public object Compose(IEnumerable o, Type t) {
+      IDictionary dict = (IDictionary)Activator.CreateInstance(t, true);
+      IEnumerator iter = o.GetEnumerator();
+      while (iter.MoveNext()) {
+        object key = iter.Current;
+        iter.MoveNext();
+        object value = iter.Current;
+        dict.Add(key, value);
+      }
+      return dict;
+    }
+  }
+
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/EnumerableFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/EnumerableFormatters.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/EnumerableFormatters.cs	(revision 1360)
@@ -0,0 +1,56 @@
+﻿using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+using System;
+
+namespace HeuristicLab.Persistence {
+  
+
+  public abstract class NumberEnumeration2XmlFormatter : IFormatter {
+
+    public abstract Type Type { get; }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    protected virtual string Separator { get { return ";"; } }
+    protected abstract void Add(IEnumerable enumeration, object o);
+    protected abstract object Instantiate();
+    protected abstract string formatValue(object o);
+    protected abstract object parseValue(string o);
+
+    public object DoFormat(object o) {
+      StringBuilder sb = new StringBuilder();
+      foreach (var value in (IEnumerable)o) {
+        sb.Append(formatValue(value));
+        sb.Append(Separator);
+      }
+      return sb.ToString();
+    }
+
+    public object Parse(object o) {
+      IEnumerable enumeration = (IEnumerable)Instantiate();
+      string[] values = ((string)o).Split(new[] { Separator }, StringSplitOptions.RemoveEmptyEntries);
+      foreach (var value in values) {
+        Add(enumeration, parseValue(value));
+      }
+      return enumeration;
+    }
+  }
+
+
+  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {
+    public override Type Type { get { return typeof(List<int>); } }
+    protected override void Add(IEnumerable enumeration, object o) { ((List<int>)enumeration).Add((int)o); }
+    protected override object Instantiate() { return new List<int>(); }
+    protected override string formatValue(object o) { return o.ToString(); }
+    protected override object parseValue(string o) { return int.Parse(o); }
+  }
+
+
+  public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatter {
+    public override Type Type { get { return typeof(List<double>); } }
+    protected override void Add(IEnumerable enumeration, object o) { ((List<double>)enumeration).Add((int)o); }
+    protected override object Instantiate() { return new List<double>(); }
+    protected override string formatValue(object o) { return ((double)o).ToString("r"); }
+    protected override object parseValue(string o) { return double.Parse(o); }
+  }
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/NumberArrayFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/NumberArrayFormatters.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/NumberArrayFormatters.cs	(revision 1360)
@@ -0,0 +1,95 @@
+﻿using System.Collections;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+using System;
+
+namespace HeuristicLab.Persistence {
+                                                              
+  public abstract class NumberArray2XmlFormatter : IFormatter {
+
+    public abstract Type Type { get; }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    protected virtual string Separator { get { return ";"; } }
+    protected abstract string formatValue(object o);
+    protected abstract object parseValue(string o);
+
+    public object DoFormat(object obj) {
+      Array a = (Array)obj;
+      StringBuilder sb = new StringBuilder();
+      sb.Append(a.Rank);
+      for (int i = 0; i < a.Rank; i++) {
+        sb.Append(Separator);
+        sb.Append(a.GetLength(i));
+      }
+      foreach (object o in a) {
+        sb.Append(Separator);
+        sb.Append(formatValue(o));
+      }
+      return sb.ToString();
+    }
+
+    public object Parse(object o) {
+      IEnumerator values =
+        ((string)o)
+        .Split(new[] { Separator },
+        StringSplitOptions.RemoveEmptyEntries).GetEnumerator();
+      values.MoveNext();
+      int rank = int.Parse((string)values.Current);
+      int[] lengths = new int[rank];
+      for (int i = 0; i < rank; i++) {
+        values.MoveNext();
+        lengths[i] = int.Parse((string)values.Current);
+      }
+      Array a = Array.CreateInstance(this.Type.GetElementType(), lengths);
+      int[] positions = new int[rank];
+      while (values.MoveNext()) {
+        a.SetValue(parseValue((string)values.Current), positions);
+        positions[0] += 1;
+        for (int i = 0; i < rank - 1; i++) {
+          if (positions[i] >= lengths[i]) {
+            positions[i] = 0;
+            positions[i + 1] += 1;
+          } else {
+            break;
+          }
+        }
+      }
+      return a;
+    }
+  }
+
+
+  public class IntArray2XmlFormatter : NumberArray2XmlFormatter {
+    public override Type Type { get { return typeof(int[]); } }
+    protected override string formatValue(object o) { return o.ToString(); }
+    protected override object parseValue(string o) { return int.Parse(o); }
+  }
+
+
+  public class Int2DArray2XmlFormatter : IntArray2XmlFormatter {
+    public override Type Type { get { return typeof(int[,]); } }
+  }
+
+
+  public class Int3DArray2XmlFormatter : IntArray2XmlFormatter {
+    public override Type Type { get { return typeof(int[, ,]); } }
+  }
+
+
+  public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {
+    public override Type Type { get { return typeof(double[]); } }
+    protected override string formatValue(object o) { return ((double)o).ToString("r"); }
+    protected override object parseValue(string o) { return double.Parse(o); }
+  }
+
+
+  public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatter {
+    public override Type Type { get { return typeof(double[,]); } }
+  }
+
+
+  public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatter {
+    public override Type Type { get { return typeof(double[, ,]); } }
+  }
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/PrimitiveFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/PrimitiveFormatters.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/PrimitiveFormatters.cs	(revision 1360)
@@ -0,0 +1,77 @@
+﻿using System;
+using System.Text;
+using System.Globalization;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence {
+
+  public class XmlFormat : IFormat {
+    public string Name { get { return "XML"; } }
+    public static readonly XmlFormat Instance = new XmlFormat();    
+  }
+
+  public class String2XmlFormatter : IFormatter {
+    public Type Type { get { return typeof(string); } }
+    public IFormat Format { get { return XmlFormat.Instance;  } }
+    public object DoFormat(object o) {      
+      return "<![CDATA[" +
+        ((string)o).Replace("]]>", "]]]]><![CDATA[>") +
+        "]]>";
+    }
+    public object Parse(object o) {
+      StringBuilder sb = new StringBuilder();
+      foreach (string s in ((string)o).Split(
+        new[] { "<![CDATA[", "]]>" },
+        StringSplitOptions.RemoveEmptyEntries)) {
+        sb.Append(s);
+      }
+      return sb.ToString();
+    }
+  }
+
+  public class Int2XmlFormatter : IFormatter {
+    public Type Type { get { return typeof(int); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    public object DoFormat(object o) {
+      return ((int)o).ToString();
+    }
+    public object Parse(object o) {
+      return int.Parse((string)o);
+    }
+  }
+
+  public class Double2XmlFormatter : IFormatter {    
+    public Type Type { get { return typeof(double); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    public object DoFormat(object o) {
+      return ((double)o).ToString("r", CultureInfo.InvariantCulture);      
+    }
+    public object Parse(object o) {
+      return double.Parse((string)o, CultureInfo.InvariantCulture);
+    }
+  }
+
+  public class Boolean2XmlFormatter : IFormatter {    
+    public Type Type { get { return typeof(bool); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }
+    public object DoFormat(object o) {
+      return ((bool)o).ToString();
+    }
+    public object Parse(object o) {
+      return bool.Parse((string)o);
+    }
+  }
+
+  public class DateTime2XmlFormatter : IFormatter {    
+    public Type Type { get { return typeof(DateTime); } }
+    public IFormat Format { get { return XmlFormat.Instance; } }  
+    public object DoFormat(object o) {
+      return ((DateTime)o).Ticks.ToString();      
+    }
+    public object Parse(object o) {
+      return new DateTime(long.Parse((string)o));
+    }
+  }
+
+  
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlFormatter.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlFormatter.cs	(revision 1360)
@@ -0,0 +1,122 @@
+﻿using System.Collections.Generic;
+using System;
+using System.Text;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence {
+
+  struct XmlStrings {
+    public const string PRIMITIVE = "PRIMITVE";
+    public const string COMPOSITE = "COMPOSITE";
+    public const string REFERENCE = "REFERENCE";
+    public const string NULL = "NULL";
+    public const string TYPECACHE = "TYPCACHE";
+    public const string TYPE = "TYPE";
+  }
+  
+  public class XmlFormatter {
+    
+    delegate string Formatter(ISerializationToken token);
+
+    private readonly Dictionary<Type, Formatter> formatters;
+    private int depth;
+
+    public XmlFormatter() {
+      formatters = new Dictionary<Type, Formatter>{
+                       {typeof (BeginToken), FormatBegin},
+                       {typeof (EndToken), FormatEnd},
+                       {typeof (PrimitiveToken), FormatPrimitive},
+                       {typeof (ReferenceToken), FormatReference},
+                       {typeof (NullReferenceToken), FormatNullReference}
+                     };
+      depth = 0;
+    }
+
+    private enum NodeType { Start, End, Inline } ;
+
+    private static string FormatNode(string name, Dictionary<string, string> attributes, NodeType type) {
+      StringBuilder sb = new StringBuilder();
+      sb.Append('<');
+      if (type == NodeType.End)
+        sb.Append('/');
+      sb.Append(name);      
+      foreach (var attribute in attributes) {
+        sb.Append(' ');
+        sb.Append(attribute.Key);
+        sb.Append("=\"");
+        sb.Append(attribute.Value);
+        sb.Append('"');
+      }
+      if (type == NodeType.Inline)
+        sb.Append('/');
+      sb.Append(">");
+      return sb.ToString();      
+    }
+
+    public string Format(ISerializationToken token) {
+      return formatters[token.GetType()](token);
+    }
+
+    private string Prefix {
+      get { return new string(' ', depth * 2); }
+    }
+
+    private string FormatBegin(ISerializationToken token) {      
+      BeginToken beginToken = (BeginToken)token;
+      var attributes = new Dictionary<string, string> {{"name", beginToken.Name}};
+      if ( beginToken.TypeId != null )
+        attributes.Add("typeId", beginToken.TypeId.ToString());
+      if ( beginToken.Id != null ) 
+        attributes.Add("id", beginToken.Id.ToString());                                           
+      string result = Prefix +
+                      FormatNode(XmlStrings.COMPOSITE, attributes, NodeType.Start) + "\n";
+      depth += 1;
+      return result;
+    }
+
+    private string FormatEnd(ISerializationToken token) {      
+      depth -= 1;
+      return Prefix + "</" + XmlStrings.COMPOSITE + ">\n";
+    }
+
+    private string FormatPrimitive(ISerializationToken token) {
+      PrimitiveToken dataToken = (PrimitiveToken)token;
+      Dictionary<string, string> attributes =
+        new Dictionary<string, string> {
+            {"typeId", dataToken.TypeId.ToString()}};
+      if ( !string.IsNullOrEmpty(dataToken.Name) )
+        attributes.Add("name", dataToken.Name);
+      if ( dataToken.Id != null )
+        attributes.Add("id", dataToken.Id.ToString());
+      return Prefix +
+        FormatNode(XmlStrings.PRIMITIVE, attributes, NodeType.Start) +
+        dataToken.SerialData + "</" + XmlStrings.PRIMITIVE + ">\n";      
+    }
+
+    private string FormatReference(ISerializationToken token) {
+      ReferenceToken refToken = (ReferenceToken) token;
+      Dictionary<string, string> attributes =
+        new Dictionary<string, string> {{"ref", refToken.Id.ToString()}};
+      if ( refToken.Name != null )
+        attributes.Add("name", refToken.Name);
+      return Prefix + FormatNode(XmlStrings.REFERENCE, attributes, NodeType.Inline) + "\n";  
+    }
+
+    private string FormatNullReference(ISerializationToken token) {
+      NullReferenceToken nullRefToken = (NullReferenceToken)token;
+      Dictionary<string, string> attributes = new Dictionary<string, string>();
+      if (nullRefToken.Name != null)
+        attributes.Add("name", nullRefToken.Name);
+      return Prefix + FormatNode(XmlStrings.NULL, attributes, NodeType.Inline) + "\n";
+    }
+
+    public IEnumerable<string> Format(Dictionary<string, int> typeCache) {
+      yield return "<" + XmlStrings.TYPECACHE + ">";
+      foreach ( var pair in typeCache ) {
+        yield return String.Format("  <" + XmlStrings.TYPE + " id=\"{0}\" name=\"{1}\"/>",
+                                   pair.Value, pair.Key);        
+      }
+      yield return "</" + XmlStrings.TYPECACHE + ">";
+    }
+  }
+}
Index: /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlParser.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlParser.cs	(revision 1360)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Default/XmlParser.cs	(revision 1360)
@@ -0,0 +1,98 @@
+﻿using System.Xml;
+using System.Collections.Generic;
+using System;
+using System.Collections;
+using System.IO;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence {
+
+
+  public class XmlParser : IEnumerable<ISerializationToken> {
+
+    private readonly XmlReader reader;
+    private delegate IEnumerator<ISerializationToken> Handler();
+    private readonly Dictionary<string, Handler> handlers;
+
+    public XmlParser(TextReader input) {
+      XmlReaderSettings settings = new XmlReaderSettings {
+                                       ConformanceLevel = ConformanceLevel.Document,
+                                       IgnoreWhitespace = true,
+                                       IgnoreComments = true
+                                     };
+      reader = XmlReader.Create(input, settings);
+      handlers = new Dictionary<string, Handler> {
+                     {XmlStrings.PRIMITIVE, ParsePrimitive},
+                     {XmlStrings.COMPOSITE, ParseComposite},
+                     {XmlStrings.REFERENCE, ParseReference},
+                     {XmlStrings.NULL, ParseNull}
+                   };
+    }
+    public IEnumerator<ISerializationToken> GetEnumerator() {
+      while (reader.Read()) {
+        if (!reader.IsStartElement()) {
+          break;
+        }
+        IEnumerator<ISerializationToken> iterator;
+        try {
+          iterator = handlers[reader.Name].Invoke();
+        }
+        catch (KeyNotFoundException) {
+          throw new InvalidOperationException(String.Format(
+            "No handler for XML tag \"{0}\" installed",
+            reader.Name));
+        }
+        while (iterator.MoveNext()) {
+          yield return iterator.Current;
+        }
+      }
+    }
+    private IEnumerator<ISerializationToken> ParsePrimitive() {
+      int? id = null;
+      string idString = reader.GetAttribute("id");
+      if (idString != null)
+        id = int.Parse(idString);
+      yield return new PrimitiveToken(
+        reader.GetAttribute("name"),
+        int.Parse(reader.GetAttribute("typeId")),
+        reader.ReadString(),
+        id);
+    }
+    private IEnumerator<ISerializationToken> ParseComposite() {
+      string name = reader.GetAttribute("name");            
+      string idString = reader.GetAttribute("id");
+      int? id = null;
+      int? typeId = null;
+      if (idString != null)
+        id = int.Parse(idString);
+        typeId = int.Parse(reader.GetAttribute("typeId"));
+      yield return new BeginToken(name, typeId, id);
+      IEnumerator<ISerializationToken> iterator = GetEnumerator();
+      while (iterator.MoveNext())
+        yield return iterator.Current;
+      yield return new EndToken(name, typeId, id);
+    }
+    private IEnumerator<ISerializationToken> ParseReference() {
+      yield return new ReferenceToken(
+        reader.GetAttribute("name"),
+        int.Parse(reader.GetAttribute("ref")));
+    }
+    private IEnumerator<ISerializationToken> ParseNull() {
+      yield return new NullReferenceToken(reader.GetAttribute("name"));
+    }
+    IEnumerator IEnumerable.GetEnumerator() {
+      return GetEnumerator();
+    }
+    public static Dictionary<string, int> ParseTypeCache(TextReader reader) {
+      Dictionary<string, int> typeCache = new Dictionary<string, int>();
+      XmlReader xmlReader = XmlReader.Create(reader);
+      while ( xmlReader.Read() ) {
+        if (xmlReader.Name == XmlStrings.TYPE) {          
+          typeCache.Add(xmlReader.GetAttribute("name")
+          , int.Parse(xmlReader.GetAttribute("id")));
+        }
+      }
+      return typeCache;
+    }
+  }  
+}
Index: anches/New Persistence Exploration/Persistence/Persistence/EnumerableFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/EnumerableFormatters.cs	(revision 1359)
+++ 	(revision )
@@ -1,56 +1,0 @@
-﻿using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-using HeuristicLab.Persistence.Interfaces;
-using System;
-
-namespace HeuristicLab.Persistence {
-  
-
-  public abstract class NumberEnumeration2XmlFormatter : IFormatter {
-
-    public abstract Type Type { get; }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    protected virtual string Separator { get { return ";"; } }
-    protected abstract void Add(IEnumerable enumeration, object o);
-    protected abstract object Instantiate();
-    protected abstract string formatValue(object o);
-    protected abstract object parseValue(string o);
-
-    public object Serialize(object o) {
-      StringBuilder sb = new StringBuilder();
-      foreach (var value in (IEnumerable)o) {
-        sb.Append(formatValue(value));
-        sb.Append(Separator);
-      }
-      return sb.ToString();
-    }
-
-    public object DeSerialize(object o) {
-      IEnumerable enumeration = (IEnumerable)Instantiate();
-      string[] values = ((string)o).Split(new[] { Separator }, StringSplitOptions.RemoveEmptyEntries);
-      foreach (var value in values) {
-        Add(enumeration, parseValue(value));
-      }
-      return enumeration;
-    }
-  }
-
-
-  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {
-    public override Type Type { get { return typeof(List<int>); } }
-    protected override void Add(IEnumerable enumeration, object o) { ((List<int>)enumeration).Add((int)o); }
-    protected override object Instantiate() { return new List<int>(); }
-    protected override string formatValue(object o) { return o.ToString(); }
-    protected override object parseValue(string o) { return int.Parse(o); }
-  }
-
-
-  public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatter {
-    public override Type Type { get { return typeof(List<double>); } }
-    protected override void Add(IEnumerable enumeration, object o) { ((List<double>)enumeration).Add((int)o); }
-    protected override object Instantiate() { return new List<double>(); }
-    protected override string formatValue(object o) { return ((double)o).ToString("r"); }
-    protected override object parseValue(string o) { return double.Parse(o); }
-  }
-}
Index: /branches/New Persistence Exploration/Persistence/Persistence/HeuristicLab.Persistence.csproj
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/HeuristicLab.Persistence.csproj	(revision 1359)
+++ /branches/New Persistence Exploration/Persistence/Persistence/HeuristicLab.Persistence.csproj	(revision 1360)
@@ -55,20 +55,21 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="ArrayFormatters.cs" />
-    <Compile Include="EnumerableFormatters.cs" />
+    <Compile Include="Default\NumberArrayFormatters.cs" />
+    <Compile Include="Core\DataMemberAccessor.cs" />
+    <Compile Include="Default\EnumerableFormatters.cs" />
     <Compile Include="HeuristicLabPersistencePlugin.cs" />
-    <Compile Include="DeSerializer.cs" />
+    <Compile Include="Core\DeSerializer.cs" />
     <Compile Include="Interfaces\IDecomposer.cs" />
     <Compile Include="Interfaces\IFormatter.cs" />
-    <Compile Include="PersistenceConfiguration.cs" />
+    <Compile Include="Core\PersistenceConfiguration.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Serializer.cs" />
-    <Compile Include="Decomposers.cs" />
-    <Compile Include="PrimitiveFormatters.cs" />
+    <Compile Include="Core\Serializer.cs" />
+    <Compile Include="Default\Decomposers.cs" />
+    <Compile Include="Default\PrimitiveFormatters.cs" />
     <Compile Include="Interfaces\Tokens.cs" />
     <Compile Include="Util.cs" />
-    <Compile Include="StorableAttribute.cs" />
-    <Compile Include="XmlFormatter.cs" />
-    <Compile Include="XmlParser.cs" />
+    <Compile Include="Core\StorableAttribute.cs" />
+    <Compile Include="Default\XmlFormatter.cs" />
+    <Compile Include="Default\XmlParser.cs" />
   </ItemGroup>
   <PropertyGroup>
Index: /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IDecomposer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IDecomposer.cs	(revision 1359)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IDecomposer.cs	(revision 1360)
@@ -5,7 +5,7 @@
 
   public interface IDecomposer {
-    bool CanSerialize(Type type);
-    IEnumerable Serialize(object obj);
-    object DeSerialize(IEnumerable objects, Type type);
+    bool CanDecompose(Type type);
+    IEnumerable DeCompose(object obj);
+    object Compose(IEnumerable objects, Type type);
   }
 
Index: /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IFormatter.cs	(revision 1359)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Interfaces/IFormatter.cs	(revision 1360)
@@ -10,6 +10,6 @@
     Type Type { get; }
     IFormat Format { get; }
-    object Serialize(object o);
-    object DeSerialize(object o);
+    object DoFormat(object o);
+    object Parse(object o);
   }
 
Index: anches/New Persistence Exploration/Persistence/Persistence/PersistenceConfiguration.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/PersistenceConfiguration.cs	(revision 1359)
+++ 	(revision )
@@ -1,114 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Reflection;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  public class Configuration {
-
-    private readonly Dictionary<Type, IFormatter> formatters;
-    private readonly List<IDecomposer> decomposers;
-    private readonly Dictionary<Type, IDecomposer> decomposerCache;
-    public readonly IFormat Format;
-
-    public Configuration(Dictionary<Type, IFormatter> formatters, IEnumerable<IDecomposer> decomposers) {      
-      this.formatters = new Dictionary<Type, IFormatter>();
-      foreach ( var pair in formatters ) {
-        if (Format == null) {
-          Format = pair.Value.Format;
-        } else if (pair.Value.Format != Format ) {
-          throw new ArgumentException("All formatters must have the same IFormat.");
-        }
-        this.formatters.Add(pair.Key, pair.Value);
-      }
-      this.decomposers = new List<IDecomposer>(decomposers);
-      decomposerCache = new Dictionary<Type, IDecomposer>();      
-    }    
-
-    public IFormatter GetFormatter(Type type) {
-      IFormatter formatter;
-      formatters.TryGetValue(type, out formatter);
-      return formatter;
-    }
-
-    public IDecomposer GetDecomposer(Type type) {
-      IDecomposer decomposer;
-      decomposerCache.TryGetValue(type, out decomposer);
-      if (decomposer != null)
-        return decomposer;
-      foreach (IDecomposer d in decomposers) {
-        if (d.CanSerialize(type)) {
-          decomposerCache.Add(type, d);
-          return d;
-        }
-      }
-      return null;
-    }
-    
-  }
-
-  public class ConfigurationService {
-
-    private readonly Dictionary<IFormat, List<IFormatter>> formatters;
-    private readonly List<IDecomposer> decomposers;
-    
-    private static ConfigurationService instance;
-    public static ConfigurationService Instance {
-      get {
-        if (instance == null) {
-          instance = new ConfigurationService();
-        }
-        return instance;
-      }
-    }
-
-    public ConfigurationService() {
-      formatters = new Dictionary<IFormat, List<IFormatter>>();
-      decomposers = new List<IDecomposer>();
-      Reset();
-    }
-
-    public void Reset() {
-      Assembly defaultAssembly = Assembly.GetExecutingAssembly();
-      DiscoverFrom(defaultAssembly);
-      foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
-        if ( a != defaultAssembly )
-          DiscoverFrom(a);
-    }
-
-    protected void DiscoverFrom(Assembly a) {
-      foreach (Type t in a.GetTypes()) {
-        if (t.GetInterface(typeof (IFormatter).FullName) != null) {
-          try {
-            IFormatter formatter = (IFormatter) Activator.CreateInstance(t, true);
-            if ( ! formatters.ContainsKey(formatter.Format) ) {
-              formatters.Add(formatter.Format, new List<IFormatter>());
-            }
-            formatters[formatter.Format].Add(formatter);
-          } catch (MissingMethodException) {
-            Console.WriteLine("WARNING: Could not instantiate {0}", t.FullName);
-          }          
-        }
-        if (t.GetInterface(typeof (IDecomposer).FullName) != null) {
-          try {
-            decomposers.Add((IDecomposer) Activator.CreateInstance(t, true));
-          } catch (MissingMethodException) {
-            Console.WriteLine("WARNING: Could not instantiate {0}", t.FullName);
-          }
-        }
-      }
-    }
-
-    public Configuration GetDefaultConfig(IFormat format) {
-      Dictionary<Type, IFormatter> formatterConfig = new Dictionary<Type, IFormatter>();
-      foreach ( IFormatter f in formatters[format] ) {
-        if ( ! formatterConfig.ContainsKey(f.Type) )
-          formatterConfig.Add(f.Type, f);
-      }
-      return new Configuration(formatterConfig, decomposers);
-    }
-
-  }
-  
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/PrimitiveFormatters.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/PrimitiveFormatters.cs	(revision 1359)
+++ 	(revision )
@@ -1,77 +1,0 @@
-﻿using System;
-using System.Text;
-using System.Globalization;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  public class XmlFormat : IFormat {
-    public string Name { get { return "XML"; } }
-    public static readonly XmlFormat Instance = new XmlFormat();    
-  }
-
-  public class String2XmlFormatter : IFormatter {
-    public Type Type { get { return typeof(string); } }
-    public IFormat Format { get { return XmlFormat.Instance;  } }
-    public object Serialize(object o) {      
-      return "<![CDATA[" +
-        ((string)o).Replace("]]>", "]]]]><![CDATA[>") +
-        "]]>";
-    }
-    public object DeSerialize(object o) {
-      StringBuilder sb = new StringBuilder();
-      foreach (string s in ((string)o).Split(
-        new[] { "<![CDATA[", "]]>" },
-        StringSplitOptions.RemoveEmptyEntries)) {
-        sb.Append(s);
-      }
-      return sb.ToString();
-    }
-  }
-
-  public class Int2XmlFormatter : IFormatter {
-    public Type Type { get { return typeof(int); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    public object Serialize(object o) {
-      return ((int)o).ToString();
-    }
-    public object DeSerialize(object o) {
-      return int.Parse((string)o);
-    }
-  }
-
-  public class Double2XmlFormatter : IFormatter {    
-    public Type Type { get { return typeof(double); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    public object Serialize(object o) {
-      return ((double)o).ToString("r", CultureInfo.InvariantCulture);      
-    }
-    public object DeSerialize(object o) {
-      return double.Parse((string)o, CultureInfo.InvariantCulture);
-    }
-  }
-
-  public class Boolean2XmlFormatter : IFormatter {    
-    public Type Type { get { return typeof(bool); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }
-    public object Serialize(object o) {
-      return ((bool)o).ToString();
-    }
-    public object DeSerialize(object o) {
-      return bool.Parse((string)o);
-    }
-  }
-
-  public class DateTime2XmlFormatter : IFormatter {    
-    public Type Type { get { return typeof(DateTime); } }
-    public IFormat Format { get { return XmlFormat.Instance; } }  
-    public object Serialize(object o) {
-      return ((DateTime)o).Ticks.ToString();      
-    }
-    public object DeSerialize(object o) {
-      return new DateTime(long.Parse((string)o));
-    }
-  }
-
-  
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/Serializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Serializer.cs	(revision 1359)
+++ 	(revision )
@@ -1,116 +1,0 @@
-﻿using System.Collections.Generic;
-using System.Collections;
-using System;
-using System.Linq;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  public class Serializer : IEnumerable<ISerializationToken> {
-
-    private readonly object obj;
-    private readonly string rootName;
-    private readonly Dictionary<object, int> obj2id;
-    private readonly Dictionary<Type, int> typeCache;
-    private readonly Configuration configuration;
-
-    public Dictionary<string, int> TypeCache {
-      get {        
-        Dictionary<string, int> result = new Dictionary<string, int>();
-        foreach ( var pair in typeCache )
-          result.Add(pair.Key.AssemblyQualifiedName, pair.Value);
-        return result;                                     
-      }
-    }
-
-    public Serializer(object obj, Configuration configuration) :        
-      this(obj, configuration, "ROOT") { }
-
-    public Serializer(object obj, Configuration configuration, string rootName) {
-      this.obj = obj;
-      this.rootName = rootName;
-      this.configuration = configuration;      
-      obj2id = new Dictionary<object, int> {{new object(), 0}};
-      typeCache = new Dictionary<Type, int>();
-    }
-
-    IEnumerator IEnumerable.GetEnumerator() {
-      return GetEnumerator();
-    }
-
-    public IEnumerator<ISerializationToken> GetEnumerator() {
-      DataMemberAccessor rootAccessor = new DataMemberAccessor(
-        rootName, obj.GetType(), null, () => obj, null);
-      IEnumerator<ISerializationToken> iterator = Serialize(rootAccessor);
-      while (iterator.MoveNext())
-        yield return iterator.Current;      
-    }
-
-    
-    private IEnumerator<ISerializationToken> Serialize(DataMemberAccessor accessor) {
-      object value = accessor.Get();
-      if (value == null)
-        return NullReferenceEnumeration(accessor.Name);
-      if (obj2id.ContainsKey(value))
-        return ReferenceTokenEnumeration(accessor.Name, obj2id[value]);              
-      if ( ! typeCache.ContainsKey(value.GetType()))
-        typeCache.Add(value.GetType(), typeCache.Count);
-      int typeId = typeCache[value.GetType()];
-      int? id = null;
-      if ( ! value.GetType().IsValueType) {
-        id = obj2id.Count;
-        obj2id.Add(value, (int)id);
-      }
-      IFormatter formatter = configuration.GetFormatter(value.GetType());
-      if (formatter != null)
-        return PrimitiveEnumeration(accessor.Name, typeId, formatter.Serialize(value), id);
-      IDecomposer decomposer = configuration.GetDecomposer(value.GetType()); 
-      if (decomposer != null)
-        return CompositeEnumeration(accessor.Name, decomposer.Serialize(value), id, typeId);            
-      return StorableEnumeration(accessor.Name, value, id, typeId);
-    }
-
-    private IEnumerator<ISerializationToken> NullReferenceEnumeration(string name) {
-      yield return new NullReferenceToken(name);
-    }
-
-    private IEnumerator<ISerializationToken> ReferenceTokenEnumeration(string name, int id) {
-      yield return new ReferenceToken(name, id);
-    }
-
-    private IEnumerator<ISerializationToken> PrimitiveEnumeration(string name, int typeId, object serializedValue, int? id) {
-      yield return new PrimitiveToken(name, typeId, serializedValue, id);
-    }
-
-    private IEnumerator<ISerializationToken> CompositeEnumeration(string name, IEnumerable values, int? id, int typeId) {
-      yield return new BeginToken(name, typeId, id);      
-        foreach (object o in values) {
-          IEnumerator<ISerializationToken> iterator = Serialize(new DataMemberAccessor(o));
-          while (iterator.MoveNext())
-            yield return iterator.Current;
-        }
-      yield return new EndToken(name, typeId, id);        
-    }
-
-    private IEnumerator<ISerializationToken> StorableEnumeration(string name, object value, int? id, int typeId) {            
-      yield return new BeginToken(name, typeId, id);
-      int nSubComponents = 0;
-      foreach (KeyValuePair<string, DataMemberAccessor> mapping in
-        StorableAttribute.GetAutostorableAccessors(value)) {
-        nSubComponents += 1;
-        IEnumerator<ISerializationToken> iterator = Serialize(mapping.Value);
-        while (iterator.MoveNext()) {
-          yield return iterator.Current;
-        }
-      }
-      if (nSubComponents == 0) {
-        throw new ApplicationException(String.Format(
-                                         "Composite value of type \"{0}\" contains no subcomponents",
-                                         value.GetType().FullName));
-      }
-      yield return new EndToken(name, typeId, id);
-    }
-  }
-
-
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/StorableAttribute.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/StorableAttribute.cs	(revision 1359)
+++ 	(revision )
@@ -1,277 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Linq;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  [AttributeUsage(
-    AttributeTargets.Field | AttributeTargets.Property,
-    AllowMultiple=false,
-    Inherited=false)]
-  public class StorableAttribute : Attribute {
-
-    public string Name { get; set; }
-    public object DefaultValue { get; set; }
-
-    private const BindingFlags instanceMembers =
-      BindingFlags.Instance |
-      BindingFlags.Public |
-      BindingFlags.NonPublic;
-    
-    public static IEnumerable<KeyValuePair<StorableAttribute, MemberInfo>> GetStorableMembers(Type type) {
-      return GetStorableMembers(type, true);      
-    }
-
-    public static IEnumerable<KeyValuePair<StorableAttribute, MemberInfo>>
-        GetStorableMembers(Type type, bool inherited) {
-      if (type.BaseType != null)
-        foreach ( var pair in GetStorableMembers(type.BaseType) )
-          yield return pair;
-      foreach (MemberInfo memberInfo in type.GetMembers(instanceMembers)) {
-        foreach (object attribute in memberInfo.GetCustomAttributes(false)) {          
-          StorableAttribute storableAttribute =
-            attribute as StorableAttribute;
-          if (storableAttribute != null) {
-            yield return new KeyValuePair<StorableAttribute, MemberInfo>(storableAttribute, memberInfo);            
-          }
-        }
-      }      
-    }
-
-    public static Dictionary<string, DataMemberAccessor> GetAutostorableAccessors(object obj) {
-      Dictionary<string, DataMemberAccessor> storableAccessors =
-        new Dictionary<string, DataMemberAccessor>();
-      foreach (KeyValuePair<StorableAttribute, MemberInfo> pair in GetStorableMembers(obj.GetType())) {
-        storableAccessors.Add(pair.Value.Name,
-          new DataMemberAccessor(pair.Value, pair.Key, obj));
-      }            
-      return storableAccessors;
-    }    
-  }
-
-  public class CloningFactory {
-
-    private static readonly CloningFactory instance = new CloningFactory();
-
-    public static T DefaultClone<T>(T obj) {
-      return instance.Clone(obj);
-    }
-
-    private readonly List<IDecomposer> compoundSerializers;
-
-    public CloningFactory(IEnumerable<IDecomposer> compoundSerializers) {
-      this.compoundSerializers = new List<IDecomposer>(compoundSerializers);
-    }
-
-    public CloningFactory() :
-      this(InterfaceInstantiatior.InstantiateAll<IDecomposer>()) { }
-
-    delegate object CloneMethod(object obj, Dictionary<object, object> twins);
-
-    readonly Dictionary<Type, CloneMethod> cloneMethods = new Dictionary<Type, CloneMethod>();
-
-    public T Clone<T>(T obj) {
-      Dictionary<object, object> twins = new Dictionary<object, object>();
-      return Clone(obj, twins);
-    }
-
-    public T Clone<T>(T obj, Dictionary<object, object> twins) {
-      ValueType t = obj as ValueType;
-      if (t != null)
-        return obj;
-
-      // ReSharper disable CompareNonConstrainedGenericWithNull
-      if (obj == null)
-      // ReSharper restore CompareNonConstrainedGenericWithNull
-        return default(T);
-
-      if (twins.ContainsKey(obj))
-        return (T)twins[obj];
-
-      ICloneable c = obj as ICloneable;
-      if (c != null) {
-        T newClone = (T)c.Clone();
-        twins[obj] = newClone;
-        return newClone;
-      }
-
-      Type type = obj.GetType();
-      if (!cloneMethods.ContainsKey(type))
-        cloneMethods[type] = CreateCloneMethod(type);
-      return (T)cloneMethods[type](obj, twins);
-    }
-
-    private CloneMethod CreateCloneMethod(Type type) {
-      if (type.GetConstructor(new[] { type }) != null)
-        return CopyConstructorCloneMethod.Create(type);
-      foreach (IDecomposer serializer in compoundSerializers)
-        if (serializer.CanSerialize(type))
-          return CompoundSerializerCloneMethod.Create(serializer, type, this);
-      return StorableAccessorCloneMethod.Create(type, this);      
-    }
-
-    class CopyConstructorCloneMethod {
-      public static CloneMethod Create(Type type) {
-        return new CopyConstructorCloneMethod(type).method;
-      }
-      private readonly ConstructorInfo constructorInfo;
-      public CopyConstructorCloneMethod(Type type) {
-        constructorInfo = type.GetConstructor(new[] { type });
-      }
-      object method(object obj, Dictionary<object, object> twins) {
-        object newInstance = constructorInfo.Invoke(new[] { obj });
-        twins.Add(obj, newInstance);
-        return newInstance;
-      }
-    }
-
-    class CompoundSerializerCloneMethod {
-      public static CloneMethod Create(IDecomposer serializer,
-          Type type, CloningFactory factory) {
-        return new CompoundSerializerCloneMethod(serializer, type, factory).method;
-      }
-      private readonly IDecomposer serializer;
-      private readonly Type type;
-      private readonly CloningFactory factory;
-      public CompoundSerializerCloneMethod(IDecomposer serializer,
-          Type type, CloningFactory factory) {
-        this.serializer = serializer;
-        this.type = type;
-        this.factory = factory;
-      }
-      object method(object obj, Dictionary<object, object> twins) {
-        return serializer.DeSerialize(
-          serializer.Serialize(obj)
-          .OfType<object>()
-          .Select(o => factory.Clone(o, twins)),
-          type);          
-      }
-    }
-
-    class StorableAccessorCloneMethod {
-
-      delegate object GetterMethod(object target);
-      delegate void SetterMethod(object target, object value);
-
-      struct FieldAccessor {      
-        public readonly GetterMethod Getter;
-        public readonly SetterMethod Setter;
-        public FieldAccessor(GetterMethod getter, SetterMethod setter) {
-          Getter = getter;
-          Setter = setter;
-        }
-      }
-
-      private const BindingFlags INSTANCE_MEMBERS =
-        BindingFlags.Instance |
-        BindingFlags.Public |
-        BindingFlags.NonPublic;
-
-      public static CloneMethod Create(Type type, CloningFactory factory) {
-        return new StorableAccessorCloneMethod(type, factory).method;
-      }
-
-      private readonly List<FieldAccessor> fieldAccessors;
-      private readonly CloningFactory factory;
-         
-      public StorableAccessorCloneMethod(Type type, CloningFactory factory) {
-        this.factory = factory;
-        fieldAccessors = new List<FieldAccessor>();
-        foreach (MemberInfo memberInfo in type.GetMembers(INSTANCE_MEMBERS)) {
-          foreach (object attribute in memberInfo.GetCustomAttributes(false)) {
-            StorableAttribute autoStorableAttribute =
-              attribute as StorableAttribute;
-            if (autoStorableAttribute != null) {
-              if (memberInfo.MemberType == MemberTypes.Field) {
-                FieldInfo fi = (FieldInfo)memberInfo;
-                fieldAccessors.Add(new FieldAccessor(
-                  fi.GetValue,
-                  fi.SetValue));
-              } else if (memberInfo.MemberType == MemberTypes.Property) {
-                PropertyInfo pi = (PropertyInfo)memberInfo;
-                fieldAccessors.Add(new FieldAccessor(
-                  target => pi.GetValue(target, null),
-                  (target, value) => pi.SetValue(target, value, null)));
-              }
-            }
-          }
-        }
-      }
-      object method(object obj, Dictionary<object, object> twins) {
-        object newInstance = Activator.CreateInstance(obj.GetType(), true);
-        twins.Add(obj, newInstance);
-        foreach (FieldAccessor fa in fieldAccessors) {
-          fa.Setter(newInstance, factory.Clone(fa.Getter(obj), twins));
-        }
-        return newInstance;
-      }
-    }
-  }  
-    
-  public class DataMemberAccessor {
-
-    public delegate object Getter();
-    public delegate void Setter(object value);
-
-    public readonly Getter Get;
-    public readonly Setter Set;
-    public readonly string Name;
-    public readonly Type Type;
-    public readonly object DefaultValue;
-
-    public DataMemberAccessor(
-        MemberInfo memberInfo,
-        StorableAttribute autoStorableAttribute,
-        object obj) {
-      if (memberInfo.MemberType == MemberTypes.Field) {
-        FieldInfo fieldInfo = (FieldInfo)memberInfo;
-        Get = () => fieldInfo.GetValue(obj);
-        Set = value => fieldInfo.SetValue(obj, value);
-        Type = fieldInfo.FieldType;
-      } else if (memberInfo.MemberType == MemberTypes.Property) {
-        PropertyInfo propertyInfo = (PropertyInfo)memberInfo;
-        if (!propertyInfo.CanRead || !propertyInfo.CanWrite) {
-          throw new NotSupportedException(
-            "Storable properties must implement both a Get and a Set Accessor. ");
-        }
-        Get = () => propertyInfo.GetValue(obj, null);
-        Set = value => propertyInfo.SetValue(obj, value, null);
-        Type = propertyInfo.PropertyType;
-      } else {
-        throw new NotSupportedException(
-                "The Storable attribute can only be applied to fields and properties.");
-      }      
-      Name = autoStorableAttribute.Name ?? memberInfo.Name;      
-      DefaultValue = autoStorableAttribute.DefaultValue;                  
-    }
-
-    public DataMemberAccessor(
-        string name, Type type, object defaultValue,
-        Getter getter, Setter setter) {
-      Name = name;
-      Type = type;
-      DefaultValue = defaultValue;
-      Get = getter;
-      Set = setter;
-    }
-
-    public DataMemberAccessor(object o) {      
-      Name = null;
-      Type = o.GetType();
-      DefaultValue = null;
-      Get = () => o;
-      Set = null;
-    }        
-    public override string ToString() {
-      return String.Format("DataMember({0}, {1}, {2}, {3}, {4}",
-        Name,
-        Type == null ? "<null>" : Type.FullName,
-        DefaultValue ?? "<null>",
-        Get.Method,
-        Set.Method);
-    }
-  }
-
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/XmlFormatter.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/XmlFormatter.cs	(revision 1359)
+++ 	(revision )
@@ -1,122 +1,0 @@
-﻿using System.Collections.Generic;
-using System;
-using System.Text;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-  struct XmlStrings {
-    public const string PRIMITIVE = "PRIMITVE";
-    public const string COMPOSITE = "COMPOSITE";
-    public const string REFERENCE = "REFERENCE";
-    public const string NULL = "NULL";
-    public const string TYPECACHE = "TYPCACHE";
-    public const string TYPE = "TYPE";
-  }
-  
-  public class XmlFormatter {
-    
-    delegate string Formatter(ISerializationToken token);
-
-    private readonly Dictionary<Type, Formatter> formatters;
-    private int depth;
-
-    public XmlFormatter() {
-      formatters = new Dictionary<Type, Formatter>{
-                       {typeof (BeginToken), FormatBegin},
-                       {typeof (EndToken), FormatEnd},
-                       {typeof (PrimitiveToken), FormatPrimitive},
-                       {typeof (ReferenceToken), FormatReference},
-                       {typeof (NullReferenceToken), FormatNullReference}
-                     };
-      depth = 0;
-    }
-
-    private enum NodeType { Start, End, Inline } ;
-
-    private static string FormatNode(string name, Dictionary<string, string> attributes, NodeType type) {
-      StringBuilder sb = new StringBuilder();
-      sb.Append('<');
-      if (type == NodeType.End)
-        sb.Append('/');
-      sb.Append(name);      
-      foreach (var attribute in attributes) {
-        sb.Append(' ');
-        sb.Append(attribute.Key);
-        sb.Append("=\"");
-        sb.Append(attribute.Value);
-        sb.Append('"');
-      }
-      if (type == NodeType.Inline)
-        sb.Append('/');
-      sb.Append(">");
-      return sb.ToString();      
-    }
-
-    public string Format(ISerializationToken token) {
-      return formatters[token.GetType()](token);
-    }
-
-    private string Prefix {
-      get { return new string(' ', depth * 2); }
-    }
-
-    private string FormatBegin(ISerializationToken token) {      
-      BeginToken beginToken = (BeginToken)token;
-      var attributes = new Dictionary<string, string> {{"name", beginToken.Name}};
-      if ( beginToken.TypeId != null )
-        attributes.Add("typeId", beginToken.TypeId.ToString());
-      if ( beginToken.Id != null ) 
-        attributes.Add("id", beginToken.Id.ToString());                                           
-      string result = Prefix +
-                      FormatNode(XmlStrings.COMPOSITE, attributes, NodeType.Start) + "\n";
-      depth += 1;
-      return result;
-    }
-
-    private string FormatEnd(ISerializationToken token) {      
-      depth -= 1;
-      return Prefix + "</" + XmlStrings.COMPOSITE + ">\n";
-    }
-
-    private string FormatPrimitive(ISerializationToken token) {
-      PrimitiveToken dataToken = (PrimitiveToken)token;
-      Dictionary<string, string> attributes =
-        new Dictionary<string, string> {
-            {"typeId", dataToken.TypeId.ToString()}};
-      if ( !string.IsNullOrEmpty(dataToken.Name) )
-        attributes.Add("name", dataToken.Name);
-      if ( dataToken.Id != null )
-        attributes.Add("id", dataToken.Id.ToString());
-      return Prefix +
-        FormatNode(XmlStrings.PRIMITIVE, attributes, NodeType.Start) +
-        dataToken.SerialData + "</" + XmlStrings.PRIMITIVE + ">\n";      
-    }
-
-    private string FormatReference(ISerializationToken token) {
-      ReferenceToken refToken = (ReferenceToken) token;
-      Dictionary<string, string> attributes =
-        new Dictionary<string, string> {{"ref", refToken.Id.ToString()}};
-      if ( refToken.Name != null )
-        attributes.Add("name", refToken.Name);
-      return Prefix + FormatNode(XmlStrings.REFERENCE, attributes, NodeType.Inline) + "\n";  
-    }
-
-    private string FormatNullReference(ISerializationToken token) {
-      NullReferenceToken nullRefToken = (NullReferenceToken)token;
-      Dictionary<string, string> attributes = new Dictionary<string, string>();
-      if (nullRefToken.Name != null)
-        attributes.Add("name", nullRefToken.Name);
-      return Prefix + FormatNode(XmlStrings.NULL, attributes, NodeType.Inline) + "\n";
-    }
-
-    public IEnumerable<string> Format(Dictionary<string, int> typeCache) {
-      yield return "<" + XmlStrings.TYPECACHE + ">";
-      foreach ( var pair in typeCache ) {
-        yield return String.Format("  <" + XmlStrings.TYPE + " id=\"{0}\" name=\"{1}\"/>",
-                                   pair.Value, pair.Key);        
-      }
-      yield return "</" + XmlStrings.TYPECACHE + ">";
-    }
-  }
-}
Index: anches/New Persistence Exploration/Persistence/Persistence/XmlParser.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/XmlParser.cs	(revision 1359)
+++ 	(revision )
@@ -1,98 +1,0 @@
-﻿using System.Xml;
-using System.Collections.Generic;
-using System;
-using System.Collections;
-using System.IO;
-using HeuristicLab.Persistence.Interfaces;
-
-namespace HeuristicLab.Persistence {
-
-
-  public class XmlParser : IEnumerable<ISerializationToken> {
-
-    private readonly XmlReader reader;
-    private delegate IEnumerator<ISerializationToken> Handler();
-    private readonly Dictionary<string, Handler> handlers;
-
-    public XmlParser(TextReader input) {
-      XmlReaderSettings settings = new XmlReaderSettings {
-                                       ConformanceLevel = ConformanceLevel.Document,
-                                       IgnoreWhitespace = true,
-                                       IgnoreComments = true
-                                     };
-      reader = XmlReader.Create(input, settings);
-      handlers = new Dictionary<string, Handler> {
-                     {XmlStrings.PRIMITIVE, ParsePrimitive},
-                     {XmlStrings.COMPOSITE, ParseComposite},
-                     {XmlStrings.REFERENCE, ParseReference},
-                     {XmlStrings.NULL, ParseNull}
-                   };
-    }
-    public IEnumerator<ISerializationToken> GetEnumerator() {
-      while (reader.Read()) {
-        if (!reader.IsStartElement()) {
-          break;
-        }
-        IEnumerator<ISerializationToken> iterator;
-        try {
-          iterator = handlers[reader.Name].Invoke();
-        }
-        catch (KeyNotFoundException) {
-          throw new InvalidOperationException(String.Format(
-            "No handler for XML tag \"{0}\" installed",
-            reader.Name));
-        }
-        while (iterator.MoveNext()) {
-          yield return iterator.Current;
-        }
-      }
-    }
-    private IEnumerator<ISerializationToken> ParsePrimitive() {
-      int? id = null;
-      string idString = reader.GetAttribute("id");
-      if (idString != null)
-        id = int.Parse(idString);
-      yield return new PrimitiveToken(
-        reader.GetAttribute("name"),
-        int.Parse(reader.GetAttribute("typeId")),
-        reader.ReadString(),
-        id);
-    }
-    private IEnumerator<ISerializationToken> ParseComposite() {
-      string name = reader.GetAttribute("name");            
-      string idString = reader.GetAttribute("id");
-      int? id = null;
-      int? typeId = null;
-      if (idString != null)
-        id = int.Parse(idString);
-        typeId = int.Parse(reader.GetAttribute("typeId"));
-      yield return new BeginToken(name, typeId, id);
-      IEnumerator<ISerializationToken> iterator = GetEnumerator();
-      while (iterator.MoveNext())
-        yield return iterator.Current;
-      yield return new EndToken(name, typeId, id);
-    }
-    private IEnumerator<ISerializationToken> ParseReference() {
-      yield return new ReferenceToken(
-        reader.GetAttribute("name"),
-        int.Parse(reader.GetAttribute("ref")));
-    }
-    private IEnumerator<ISerializationToken> ParseNull() {
-      yield return new NullReferenceToken(reader.GetAttribute("name"));
-    }
-    IEnumerator IEnumerable.GetEnumerator() {
-      return GetEnumerator();
-    }
-    public static Dictionary<string, int> ParseTypeCache(TextReader reader) {
-      Dictionary<string, int> typeCache = new Dictionary<string, int>();
-      XmlReader xmlReader = XmlReader.Create(reader);
-      while ( xmlReader.Read() ) {
-        if (xmlReader.Name == XmlStrings.TYPE) {          
-          typeCache.Add(xmlReader.GetAttribute("name")
-          , int.Parse(xmlReader.GetAttribute("id")));
-        }
-      }
-      return typeCache;
-    }
-  }  
-}
Index: /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1359)
+++ /branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs	(revision 1360)
@@ -3,4 +3,5 @@
 using System.Collections.Generic;
 using System.IO;
+using HeuristicLab.Persistence.Core;
 using HeuristicLab.Persistence.Interfaces;
 
@@ -172,6 +173,5 @@
         XmlParser.ParseTypeCache(new StreamReader("test-types.xml")),
         ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));        
-      object o = deSerializer.DeSerialize(parser);
-      Root t = CloningFactory.DefaultClone(r);
+      object o = deSerializer.DeSerialize(parser);      
       Console.Out.WriteLine(Util.AutoFormat(o, true));      
     }
@@ -193,70 +193,7 @@
         XmlParser.ParseTypeCache(new StreamReader("test-types.xml")),
         ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));        
-      object o = deSerializer.DeSerialize(parser);
-      Manager n = CloningFactory.DefaultClone(m);
+      object o = deSerializer.DeSerialize(parser);      
       Console.Out.WriteLine(Util.AutoFormat(o, true));      
-    }
-
-    public static void SpeedTest() {
-      StorableObject storable = new StorableObject();
-      CloneableObject cloneable = new CloneableObject();
-      Console.Write("initializing...");
-      storable.Init();
-      cloneable.Init();
-      Console.WriteLine("done");
-      List<StorableObject> storableClones = new List<StorableObject>();
-      List<CloneableObject> clonableClones = new List<CloneableObject>();
-      CloningFactory cloningFactory = new CloningFactory();
-      for (int i = 0; i < 100000; i++) {
-        Console.Write("cloning storable.. ");
-        storableClones.Add(cloningFactory.Clone(storable));
-        Console.WriteLine();
-        Console.Write("cloning cloneable.. ");
-        clonableClones.Add((CloneableObject)cloneable.Clone());
-        Console.WriteLine();
-      }
-    }
-
-    public static void SpeedTest2() {
-      Root r = new Root();
-      r.selfReferences = new List<Root> {r, r};
-      r.c = new Custom {r = r};
-      r.dict.Add("one", 1);
-      r.dict.Add("two", 2);
-      r.dict.Add("three", 3);
-
-      CloneableRoot cr = new CloneableRoot();
-      cr.selfReferences = new List<CloneableRoot> {cr, cr};
-      cr.c = new CloneableCustom {r = cr};
-      cr.dict.Add("one", 1);
-      cr.dict.Add("two", 2);
-      cr.dict.Add("three", 3);      
-      List<Root> storableClones = new List<Root>();
-      List<CloneableRoot> clonableClones = new List<CloneableRoot>();      
-      CloningFactory cloningFactory = new CloningFactory();
-
-      DateTime start = DateTime.Now;
-      Console.Write("cloning storable.. ");
-      for (int i = 0; i < 100000; i++) {       
-        storableClones.Add(cloningFactory.Clone(r));                        
-      }
-      Console.WriteLine(new TimeSpan(DateTime.Now.Ticks - start.Ticks));
-
-      start = DateTime.Now;
-      Console.Write("cloning storable again.. ");
-      for (int i = 0; i < 100000; i++) {
-        storableClones.Add(cloningFactory.Clone(r));
-      }
-      Console.WriteLine(new TimeSpan(DateTime.Now.Ticks - start.Ticks));
-
-      start = DateTime.Now;
-      Console.Write("cloning cloneable.. ");
-      for (int i = 0; i < 100000; i++) {        
-        clonableClones.Add((CloneableRoot)cr.Clone(new Dictionary<object, object>()));
-      }
-      Console.WriteLine(new TimeSpan(DateTime.Now.Ticks - start.Ticks));
-      clonableClones.Clear();
-      
-    }
+    }    
 
     public class Base {
Index: /branches/New Persistence Exploration/Persistence/Test/StorableAttributeTests.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Test/StorableAttributeTests.cs	(revision 1359)
+++ /branches/New Persistence Exploration/Persistence/Test/StorableAttributeTests.cs	(revision 1360)
@@ -1,4 +1,5 @@
 ﻿using System;
 using System.Collections.Generic;
+using HeuristicLab.Persistence.Core;
 
 namespace HeuristicLab.Persistence.Test {
