Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs	(revision 3017)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs	(revision 3025)
@@ -60,191 +60,4 @@
       return sb.ToString();
     }
-
-    private const BindingFlags instanceMembers =
-      BindingFlags.Instance |
-      BindingFlags.Public |
-      BindingFlags.NonPublic |
-      BindingFlags.DeclaredOnly;
-
-    /// <summary>
-    /// Encapsulate information about storable members of a class
-    /// that have the storable attribute set.
-    /// </summary>
-    public sealed class StorableMemberInfo {
-
-      /// <summary>
-      /// Gets the [Storable] attribute itself.
-      /// </summary>
-      /// <value>The [Storable] attribute.</value>
-      public StorableAttribute Attribute { get; private set; }
-
-      /// <summary>
-      /// Gets the .NET reflection MemberInfo.
-      /// </summary>
-      /// <value>The member info.</value>
-      public MemberInfo MemberInfo { get; private set; }
-
-
-      /// <summary>
-      /// Gets disentangled name (i.e. unique access name regardless of
-      /// type hierarchy.
-      /// </summary>
-      /// <value>The disentangled name.</value>
-      public string DisentangledName { get; private set; }
-
-
-      /// <summary>
-      /// Gets the fully qualified member name.
-      /// </summary>
-      /// <value>The the fully qualified member name.</value>
-      public string FullyQualifiedMemberName {
-        get {
-          return new StringBuilder()
-            .Append(MemberInfo.ReflectedType.FullName)
-            .Append('.')
-            .Append(MemberInfo.Name)
-            .ToString();
-        }
-      }
-
-      internal StorableMemberInfo(StorableAttribute attribute, MemberInfo memberInfo) {
-        this.Attribute = attribute;
-        this.MemberInfo = memberInfo;
-      }
-
-      /// <summary>
-      /// Returns a <see cref="System.String"/> that represents this instance.
-      /// </summary>
-      /// <returns>
-      /// A <see cref="System.String"/> that represents this instance.
-      /// </returns>
-      public override string ToString() {
-        return new StringBuilder()
-          .Append('[').Append(Attribute).Append(", ")
-          .Append(MemberInfo).Append('}').ToString();
-      }
-
-      internal void SetDisentangledName(string name) {
-        DisentangledName = Attribute.Name ?? name;
-      }
-
-      /// <summary>
-      /// Gets the delcaring type of the property.
-      /// </summary>
-      /// <returns></returns>
-      public Type GetPropertyDeclaringBaseType() {
-        return ((PropertyInfo)MemberInfo).GetGetMethod(true).GetBaseDefinition().DeclaringType;
-      }
-    }
-
-    private sealed class TypeQuery {
-      public Type Type { get; private set; }
-      public bool Inherited { get; private set; }
-      public TypeQuery(Type type, bool inherited) {
-        this.Type = type;
-        this.Inherited = inherited;
-      }
-    }
-
-    private sealed class MemberCache : Dictionary<TypeQuery, IEnumerable<StorableMemberInfo>> { }
-
-    private static MemberCache memberCache = new MemberCache();
-
-
-    /// <summary>
-    /// Get all fields and properties of a class that have the
-    /// <c>[Storable]</c> attribute set.
-    /// </summary>
-    /// <param name="type">The type.</param>
-    /// <returns>An enumerable of StorableMemberInfos.</returns>
-    public static IEnumerable<StorableMemberInfo> GetStorableMembers(Type type) {
-      return GetStorableMembers(type, true);
-    }
-
-    /// <summary>
-    /// Get all fields and properties of a class that have the
-    /// <c>[Storable]</c> attribute set.
-    /// </summary>
-    /// <param name="type">The type.</param>
-    /// <param name="inherited">should storable members from base classes be included</param>
-    /// <returns>An enumerable of StorableMemberInfos</returns>
-    public static IEnumerable<StorableMemberInfo> GetStorableMembers(Type type, bool inherited) {
-      lock (memberCache) {
-        var query = new TypeQuery(type, inherited);
-        if (memberCache.ContainsKey(query))
-          return memberCache[query];
-        var storablesMembers = GenerateStorableMembers(type, inherited);
-        memberCache[query] = storablesMembers;
-        return storablesMembers;
-      }
-    }
-
-    private static IEnumerable<StorableMemberInfo> GenerateStorableMembers(Type type, bool inherited) {
-      var storableMembers = new List<StorableMemberInfo>();
-      if (inherited && type.BaseType != null)
-        storableMembers.AddRange(GenerateStorableMembers(type.BaseType, true));
-      foreach (MemberInfo memberInfo in type.GetMembers(instanceMembers)) {
-        foreach (StorableAttribute attribute in memberInfo.GetCustomAttributes(typeof(StorableAttribute), false)) {          
-          storableMembers.Add(new StorableMemberInfo(attribute, memberInfo));          
-        }
-      }
-      return DisentangleNameMapping(storableMembers);
-    }
-
-
-    /// <summary>
-    /// Get the associated accessors for all storable memebrs.
-    /// </summary>
-    /// <param name="obj">The object</param>
-    /// <returns>An enumerable of storable accessors.</returns>
-    public static IEnumerable<DataMemberAccessor> GetStorableAccessors(object obj) {      
-      foreach (var memberInfo in GetStorableMembers(obj.GetType()))
-        yield return new DataMemberAccessor(
-          memberInfo.MemberInfo,
-          memberInfo.DisentangledName,
-          memberInfo.Attribute.DefaultValue,
-          obj);      
-    }
-
-    private static IEnumerable<StorableMemberInfo> DisentangleNameMapping(
-        IEnumerable<StorableMemberInfo> storableMemberInfos) {
-      var nameGrouping = new Dictionary<string, List<StorableMemberInfo>>();
-      foreach (StorableMemberInfo storable in storableMemberInfos) {
-        if (!nameGrouping.ContainsKey(storable.MemberInfo.Name))
-          nameGrouping[storable.MemberInfo.Name] = new List<StorableMemberInfo>();
-        nameGrouping[storable.MemberInfo.Name].Add(storable);
-      }
-      var memberInfos = new List<StorableMemberInfo>();
-      foreach (var storableMemberInfoGroup in nameGrouping.Values) {        
-        if (storableMemberInfoGroup.Count == 1) {
-          storableMemberInfoGroup[0].SetDisentangledName(storableMemberInfoGroup[0].MemberInfo.Name);
-          memberInfos.Add(storableMemberInfoGroup[0]);
-        } else if (storableMemberInfoGroup[0].MemberInfo.MemberType == MemberTypes.Field) {
-          foreach (var storableMemberInfo in storableMemberInfoGroup) {            
-            storableMemberInfo.SetDisentangledName(storableMemberInfo.FullyQualifiedMemberName);
-            memberInfos.Add(storableMemberInfo);
-          }
-        } else {          
-          memberInfos.AddRange(MergePropertyAccessors(storableMemberInfoGroup));
-        }
-      }
-      return memberInfos;
-    }
-    
-    private static IEnumerable<StorableMemberInfo> MergePropertyAccessors(List<StorableMemberInfo> members) {
-      var uniqueAccessors = new Dictionary<Type, StorableMemberInfo>();
-      foreach (var member in members)
-        uniqueAccessors[member.GetPropertyDeclaringBaseType()] = member;                  
-      if (uniqueAccessors.Count == 1) {
-        var storableMemberInfo = uniqueAccessors.Values.First();
-        storableMemberInfo.SetDisentangledName(storableMemberInfo.MemberInfo.Name);
-        yield return storableMemberInfo;
-      } else {
-        foreach (var attribute in uniqueAccessors.Values) {
-          attribute.SetDisentangledName(attribute.FullyQualifiedMemberName);
-          yield return attribute;
-        }
-      }
-    }    
   }
 }
Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs	(revision 3017)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs	(revision 3025)
@@ -69,64 +69,5 @@
     }
 
-    /// <summary>
-    /// Check that the type is either empty i.e. has no fields or properties
-    /// or conatins proper parameterization through the storable attribute.
-    /// </summary>
-    /// <param name="type">The type.</param>
-    /// <param name="recusrive">if set to <c>true</c> recusrively checks class hierarchy.</param>
-    /// <returns>
-    /// <c>true</c> if the specified type is a storable type; otherwise, <c>false</c>.
-    /// </returns>
-    public static bool IsStorableType(Type type, bool recusrive) {
-      if (IsEmptyType(type, recusrive))
-        return true;
-      StorableClassAttribute attribute = type
-        .GetCustomAttributes(typeof(StorableClassAttribute), false)
-        .Cast<StorableClassAttribute>().SingleOrDefault();
-      if (attribute == null)
-        return false;
-      if (!recusrive || type.BaseType == null)
-        return true;
-      else
-        return IsStorableType(type.BaseType, true);
-    }
-
-    private const BindingFlags allDeclaredMembers =
-      BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly;
-
-
-    /// <summary>
-    /// Determines whether the specified type has no fields or properties except
-    /// readonly properties or constant fields.
-    /// </summary>
-    /// <param name="type">The type.</param>
-    /// <param name="recursive">if set to <c>true</c> recursively check class hierarchy.</param>
-    /// <returns>
-    /// <c>true</c> if the specified type is empty; otherwise, <c>false</c>.
-    /// </returns>
-    public static bool IsEmptyType(Type type, bool recursive) {
-      foreach (MemberInfo memberInfo in type.GetMembers(allDeclaredMembers)) {
-        if (
-          memberInfo.MemberType == MemberTypes.Field && IsModifiableField((FieldInfo)memberInfo) ||
-          memberInfo.MemberType == MemberTypes.Property && IsModifiableProperty((PropertyInfo)memberInfo)) {
-          return false;
-        }
-      }
-      if (!recursive || type.BaseType == null)
-        return true;
-      else
-        return IsEmptyType(type.BaseType, true);
-    }
-
-    private static bool IsModifiableField(FieldInfo fi) {
-      return !fi.IsLiteral && !fi.IsInitOnly;
-    }
-
-    private static bool IsModifiableProperty(PropertyInfo pi) {
-      return pi.CanWrite;
-    }
   }
 }
 
-
-  
Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs	(revision 3017)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs	(revision 3025)
@@ -18,35 +18,4 @@
   /// </summary>
   [AttributeUsage(AttributeTargets.Constructor, Inherited = false, AllowMultiple = false)]
-  public sealed class StorableConstructorAttribute : Attribute {
-
-    private static readonly BindingFlags allConstructors =
-      BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;    
-
-    private static Dictionary<Type, ConstructorInfo> constructorCache =
-      new Dictionary<Type, ConstructorInfo>();
-
-
-    /// <summary>
-    /// Get a designated storable constructor for a type or <c>null</c>.
-    /// </summary>
-    /// <param name="type">The type.</param>
-    /// <returns>The <see cref="ConstructorInfo"/> of the storable constructor or <c>null</c></returns>
-    public static ConstructorInfo GetStorableConstructor(Type type) {
-      lock (constructorCache) {
-        if (constructorCache.ContainsKey(type))
-          return constructorCache[type];
-        foreach (ConstructorInfo ci in type.GetConstructors(allConstructors)) {
-          if (ci.GetCustomAttributes(typeof(StorableConstructorAttribute), false).Length > 0) {
-            if (ci.GetParameters().Length != 1 ||
-                ci.GetParameters()[0].ParameterType != typeof(bool))
-              throw new PersistenceException("StorableConstructor must have exactly one argument of type bool");
-            constructorCache[type] = ci;
-            return ci;
-          }
-        }
-        constructorCache[type] = null;
-        return null;
-      }
-    }
-  }
+  public sealed class StorableConstructorAttribute : Attribute {  }
 }
Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs	(revision 3017)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs	(revision 3025)
@@ -6,4 +6,5 @@
 using System.Reflection;
 using HeuristicLab.Persistence.Auxiliary;
+using System.Text;
 
 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
@@ -18,4 +19,7 @@
   public class StorableSerializer : ICompositeSerializer {
 
+
+    #region ICompositeSerializer implementation
+
     public int Priority {
       get { return 200; }
@@ -24,14 +28,16 @@
     public bool CanSerialize(Type type) {
       if (!ReflectionTools.HasDefaultConstructor(type) &&
-        StorableConstructorAttribute.GetStorableConstructor(type) == null)
+        GetStorableConstructor(type) == null)
         return false;
-      return StorableClassAttribute.IsStorableType(type, true);
+      return IsEmptyOrStorableType(type, true);
     }
 
     public string JustifyRejection(Type type) {
       if (!ReflectionTools.HasDefaultConstructor(type) &&
-        StorableConstructorAttribute.GetStorableConstructor(type) == null)
+        GetStorableConstructor(type) == null)
         return "no default constructor and no storable constructor";
-      return "class or one of its base classes is not empty and has no [StorableClass] attribute";
+      if (!IsEmptyOrStorableType(type, true))
+        return "class is not marked with the storable class attribute";
+      return "no reason";
     }
 
@@ -42,5 +48,5 @@
 
     public IEnumerable<Tag> Decompose(object obj) {
-      foreach (var accessor in StorableAttribute.GetStorableAccessors(obj)) {
+      foreach (var accessor in GetStorableAccessors(obj)) {
         yield return new Tag(accessor.Name, accessor.Get());
       }
@@ -51,5 +57,5 @@
     public object CreateInstance(Type type, IEnumerable<Tag> metaInfo) {
       try {
-        ConstructorInfo constructor = StorableConstructorAttribute.GetStorableConstructor(type);
+        ConstructorInfo constructor = GetStorableConstructor(type);
         return constructor != null ? constructor.Invoke(defaultArgs) : Activator.CreateInstance(type, true);
       } catch (TargetInvocationException x) {
@@ -66,5 +72,5 @@
         memberDict.Add(iter.Current.Name, iter.Current);
       }      
-      foreach (var accessor in StorableAttribute.GetStorableAccessors(instance)) {
+      foreach (var accessor in GetStorableAccessors(instance)) {
         if (memberDict.ContainsKey(accessor.Name)) {
           accessor.Set(memberDict[accessor.Name].Value);
@@ -75,4 +81,197 @@
       StorableHookAttribute.InvokeHook(HookType.AfterDeserialization, instance);
     }
+
+    #endregion
+
+    #region constances & private data types
+
+    private const BindingFlags ALL_CONSTRUCTORS =
+      BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
+
+    private const BindingFlags DECLARED_INSTANCE_MEMBERS =
+      BindingFlags.Instance |
+      BindingFlags.Public |
+      BindingFlags.NonPublic |
+      BindingFlags.DeclaredOnly;
+
+    private sealed class StorableMemberInfo {
+      public StorableAttribute Attribute { get; private set; }
+      public MemberInfo MemberInfo { get; private set; }
+      public string DisentangledName { get; private set; }
+      public string FullyQualifiedMemberName {
+        get {
+          return new StringBuilder()
+            .Append(MemberInfo.ReflectedType.FullName)
+            .Append('.')
+            .Append(MemberInfo.Name)
+            .ToString();
+        }
+      }
+      public StorableMemberInfo(StorableAttribute attribute, MemberInfo memberInfo) {
+        this.Attribute = attribute;
+        this.MemberInfo = memberInfo;
+      }
+      public override string ToString() {
+        return new StringBuilder()
+          .Append('[').Append(Attribute).Append(", ")
+          .Append(MemberInfo).Append('}').ToString();
+      }
+      public void SetDisentangledName(string name) {
+        DisentangledName = Attribute.Name ?? name;
+      }
+      public Type GetPropertyDeclaringBaseType() {
+        return ((PropertyInfo)MemberInfo).GetGetMethod(true).GetBaseDefinition().DeclaringType;
+      }
+    }
+
+    private sealed class TypeQuery {
+      public Type Type { get; private set; }
+      public bool Inherited { get; private set; }
+      public TypeQuery(Type type, bool inherited) {
+        this.Type = type;
+        this.Inherited = inherited;
+      }
+    }
+
+    private sealed class MemberCache : Dictionary<TypeQuery, IEnumerable<StorableMemberInfo>> { }
+
+    #endregion
+
+    #region caches
+
+    private MemberCache storableMemberCache = new MemberCache();
+    private Dictionary<Type, ConstructorInfo> constructorCache = 
+      new Dictionary<Type, ConstructorInfo>();
+
+    #endregion
+
+    #region auxiliary attribute reflection tools
+
+    private IEnumerable<StorableMemberInfo> GetStorableMembers(Type type) {
+      return GetStorableMembers(type, true);
+    }
+
+    private IEnumerable<StorableMemberInfo> GetStorableMembers(Type type, bool inherited) {
+      lock (storableMemberCache) {
+        var query = new TypeQuery(type, inherited);
+        if (storableMemberCache.ContainsKey(query))
+          return storableMemberCache[query];
+        var storablesMembers = GenerateStorableMembers(type, inherited);
+        storableMemberCache[query] = storablesMembers;
+        return storablesMembers;
+      }
+    }
+
+    private static IEnumerable<StorableMemberInfo> GenerateStorableMembers(Type type, bool inherited) {
+      var storableMembers = new List<StorableMemberInfo>();
+      if (inherited && type.BaseType != null)
+        storableMembers.AddRange(GenerateStorableMembers(type.BaseType, true));
+      foreach (MemberInfo memberInfo in type.GetMembers(DECLARED_INSTANCE_MEMBERS)) {
+        foreach (StorableAttribute attribute in memberInfo.GetCustomAttributes(typeof(StorableAttribute), false)) {
+          storableMembers.Add(new StorableMemberInfo(attribute, memberInfo));
+        }
+      }
+      return DisentangleNameMapping(storableMembers);
+    }
+
+    private IEnumerable<DataMemberAccessor> GetStorableAccessors(object obj) {
+      foreach (var memberInfo in GetStorableMembers(obj.GetType()))
+        yield return new DataMemberAccessor(
+          memberInfo.MemberInfo,
+          memberInfo.DisentangledName,
+          memberInfo.Attribute.DefaultValue,
+          obj);
+    }
+
+    private static IEnumerable<StorableMemberInfo> DisentangleNameMapping(
+        IEnumerable<StorableMemberInfo> storableMemberInfos) {
+      var nameGrouping = new Dictionary<string, List<StorableMemberInfo>>();
+      foreach (StorableMemberInfo storable in storableMemberInfos) {
+        if (!nameGrouping.ContainsKey(storable.MemberInfo.Name))
+          nameGrouping[storable.MemberInfo.Name] = new List<StorableMemberInfo>();
+        nameGrouping[storable.MemberInfo.Name].Add(storable);
+      }
+      var memberInfos = new List<StorableMemberInfo>();
+      foreach (var storableMemberInfoGroup in nameGrouping.Values) {
+        if (storableMemberInfoGroup.Count == 1) {
+          storableMemberInfoGroup[0].SetDisentangledName(storableMemberInfoGroup[0].MemberInfo.Name);
+          memberInfos.Add(storableMemberInfoGroup[0]);
+        } else if (storableMemberInfoGroup[0].MemberInfo.MemberType == MemberTypes.Field) {
+          foreach (var storableMemberInfo in storableMemberInfoGroup) {
+            storableMemberInfo.SetDisentangledName(storableMemberInfo.FullyQualifiedMemberName);
+            memberInfos.Add(storableMemberInfo);
+          }
+        } else {
+          memberInfos.AddRange(MergePropertyAccessors(storableMemberInfoGroup));
+        }
+      }
+      return memberInfos;
+    }
+
+    private static IEnumerable<StorableMemberInfo> MergePropertyAccessors(List<StorableMemberInfo> members) {
+      var uniqueAccessors = new Dictionary<Type, StorableMemberInfo>();
+      foreach (var member in members)
+        uniqueAccessors[member.GetPropertyDeclaringBaseType()] = member;
+      if (uniqueAccessors.Count == 1) {
+        var storableMemberInfo = uniqueAccessors.Values.First();
+        storableMemberInfo.SetDisentangledName(storableMemberInfo.MemberInfo.Name);
+        yield return storableMemberInfo;
+      } else {
+        foreach (var attribute in uniqueAccessors.Values) {
+          attribute.SetDisentangledName(attribute.FullyQualifiedMemberName);
+          yield return attribute;
+        }
+      }
+    }
+
+    private static bool IsEmptyOrStorableType(Type type, bool recusrive) {
+      if (IsEmptyType(type, recusrive)) return true;
+      if (!HastStorableClassAttribute(type)) return false;
+      return !recusrive || type.BaseType == null || IsEmptyOrStorableType(type.BaseType, true);
+    }
+
+    private static bool HastStorableClassAttribute(Type type) {
+      return type.GetCustomAttributes(typeof(StorableClassAttribute), false).Length > 0;
+    }
+
+    private static bool IsEmptyType(Type type, bool recursive) {
+      foreach (MemberInfo memberInfo in type.GetMembers(DECLARED_INSTANCE_MEMBERS)) {
+        if (IsModifiableMember(memberInfo)) return false;
+      }
+      return !recursive || type.BaseType == null || IsEmptyType(type.BaseType, true);
+    }
+
+    private static bool IsModifiableMember(MemberInfo memberInfo) {
+      return memberInfo.MemberType == MemberTypes.Field && IsModifiableField((FieldInfo)memberInfo) ||
+                memberInfo.MemberType == MemberTypes.Property && IsModifiableProperty((PropertyInfo)memberInfo);
+    }
+
+    private static bool IsModifiableField(FieldInfo fi) {
+      return !fi.IsLiteral && !fi.IsInitOnly;
+    }
+
+    private static bool IsModifiableProperty(PropertyInfo pi) {
+      return pi.CanWrite;
+    }
+
+    private ConstructorInfo GetStorableConstructor(Type type) {
+      lock (constructorCache) {
+        if (constructorCache.ContainsKey(type))
+          return constructorCache[type];
+        foreach (ConstructorInfo ci in type.GetConstructors(ALL_CONSTRUCTORS)) {
+          if (ci.GetCustomAttributes(typeof(StorableConstructorAttribute), false).Length > 0) {
+            if (ci.GetParameters().Length != 1 ||
+                ci.GetParameters()[0].ParameterType != typeof(bool))
+              throw new PersistenceException("StorableConstructor must have exactly one argument of type bool");
+            constructorCache[type] = ci;
+            return ci;
+          }
+        }
+        constructorCache[type] = null;
+        return null;
+      }
+    }
+
+    #endregion
   }
 }
