Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1419)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs	(revision 1420)
@@ -6,19 +6,12 @@
 
   struct ParentReference { }
-  delegate void Setter(object value);
+  delegate void Setter(object value);  
 
-
-  interface IAccessibleObject {
-    object Obj { get; }
-    Setter GetSetter(string name);
-  }
-
-
-  class CustomComposite : IAccessibleObject {
+  class CompositeObject {
 
     public object Obj { get; private set; }
     public List<Tag> customValues;
 
-    public CustomComposite(object obj) {
+    public CompositeObject(object obj) {
       Obj = obj;
       customValues = new List<Tag>();
@@ -29,43 +22,9 @@
     }
 
-    public Setter GetSetter(string name) {      
-      int index = customValues.Count - 1;
-      Tag t = customValues[index];      
+    public Setter GetSetter(string name) {            
+      Tag t = customValues[customValues.Count - 1];      
       return value => t.Value = value;
     }
-  }
-
-
-  class StorableComposite : IAccessibleObject {
-
-    public object Obj { get; private set; }
-    public readonly Dictionary<string, DataMemberAccessor> accessorDict;
-
-    public StorableComposite(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 {
@@ -77,5 +36,5 @@
     private readonly Dictionary<Type, object> serializerMapping;
     private readonly Dictionary<Type, Handler> handlers;
-    private readonly Stack<IAccessibleObject> parentStack;    
+    private readonly Stack<CompositeObject> parentStack;    
     private readonly Dictionary<int, Type> typeIds;    
     private List<Thunk> finalFixes;
@@ -84,5 +43,5 @@
       IEnumerable<TypeMapping> typeCache) {      
       id2obj = new Dictionary<int, object>();
-      parentStack = new Stack<IAccessibleObject>();
+      parentStack = new Stack<CompositeObject>();
       handlers = new Dictionary<Type, Handler> {
                      {typeof (BeginToken), CompositeStartHandler},
@@ -105,5 +64,5 @@
 
     public object DeSerialize(IEnumerable<ISerializationToken> tokens) {
-      finalFixes = new List<Thunk>();
+      finalFixes = new List<Thunk>();      
       foreach (ISerializationToken token in tokens) {
         handlers[token.GetType()].Invoke(token);
@@ -126,10 +85,9 @@
         if (instance == null)
           instance = new ParentReference();
-        parentStack.Push(new CustomComposite(instance));        
-      } else {        
-        instance = Activator.CreateInstance(type, true);
-        Dictionary<string, DataMemberAccessor> accessorDict =
-          StorableAttribute.GetAutostorableAccessors(instance);
-        parentStack.Push(new StorableComposite(instance, accessorDict));        
+        parentStack.Push(new CompositeObject(instance));        
+      } else {
+        throw new ApplicationException(String.Format(
+          "No suitable method for deserialization of type \"{0}\" found.",
+          type.FullName));
       }
       if ( start.Id != null )
@@ -144,5 +102,5 @@
         decomposer = serializerMapping[type] as IDecomposer;            
       if (decomposer != null) {
-        CustomComposite customComposite = (CustomComposite)parentStack.Pop();
+        CompositeObject customComposite = (CompositeObject)parentStack.Pop();
         object deserializedObject =          
           decomposer.Populate(customComposite.Obj, customComposite.customValues, type);
@@ -151,7 +109,7 @@
         SetValue(end.Name, deserializedObject);          
       } else {
-        StorableComposite storableComposite = (StorableComposite)parentStack.Pop();
-        storableComposite.PopulateDefaultValues();
-        SetValue(end.Name, storableComposite.Obj);
+        throw new ApplicationException(String.Format(
+          "No suitable method for deserialization of type \"{0}\" found.",
+          type.FullName));
       }
     }
@@ -183,13 +141,8 @@
 
     private void SetValue(string name, object value) {
-      if (parentStack.Count == 0) {
-        parentStack.Push(new StorableComposite(value, new Dictionary<string, DataMemberAccessor>()));
-      } else {
-        object accessibleObject = parentStack.Peek();
-        if (accessibleObject is StorableComposite) {
-          ((StorableComposite)accessibleObject).SetValue(name, value);
-        } else if (accessibleObject is CustomComposite) {
-          ((CustomComposite)accessibleObject).AddValue(name, value);
-        }
+      if (parentStack.Count == 0) {        
+        parentStack.Push(new CompositeObject(value));
+      } else {        
+        parentStack.Peek().AddValue(name, value);        
       }
     }
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs	(revision 1419)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/Serializer.cs	(revision 1420)
@@ -92,6 +92,9 @@
       IDecomposer decomposer = configuration.GetDecomposer(value.GetType()); 
       if (decomposer != null)
-        return CompositeEnumerator(accessor.Name, decomposer.DeCompose(value), id, typeId);            
-      return StorableEnumerator(accessor.Name, value, id, typeId);
+        return CompositeEnumerator(accessor.Name, decomposer.DeCompose(value), id, typeId);                  
+      throw new ApplicationException(
+          String.Format(
+          "No suitable method for serializing values of type \"{0}\" found.",
+          value.GetType().FullName));      
     }
 
@@ -121,26 +124,4 @@
     }
 
-    private IEnumerator<ISerializationToken> StorableEnumerator(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 && ! EmptyStorableClassAttribute.IsEmpyStorable(value.GetType())) {
-        throw new ApplicationException(
-          String.Format(
-            "Value of type \"{0}\" has no formatter or decomposer, " +
-            "contains no storable subcomponents, " +
-            "and is not marked as empty storable class.",
-            value.GetType().FullName));
-      }
-      yield return new EndToken(name, typeId, id);
-    }
   }
 
