Commits

Anonymous committed 9772078

Simplified model, and switched to automapping/conventions instead of explicit mappings.

Comments (0)

Files changed (55)

UserProjects/sprucely/CSharp/Composer/Composer/Composer.csproj

     </Compile>
     <Compile Include="Common\Collections\ReadOnlyDictionary.cs" />
     <Compile Include="Common\TypeUtilities.cs" />
-    <Compile Include="Graph\CellFactory.cs" />
-    <Compile Include="Graph\BaseVertexCellEffector.cs" />
-    <Compile Include="Graph\VertexCellEffectorMessage.cs" />
-    <Compile Include="ORM\EdgeAssociationMap.cs" />
-    <Compile Include="ORM\CellCategoryMap.cs" />
-    <Compile Include="ORM\CellTypeMap.cs" />
-    <Compile Include="ORM\BaseCellVertexMap.cs" />
-    <Compile Include="ORM\DefinitionComponentMap.cs" />
-    <Compile Include="ORM\VertexComponentMap.cs" />
-    <Compile Include="ORM\EdgeConnectionMap.cs" />
-    <Compile Include="ORM\DefinitionConnectorMap.cs" />
-    <Compile Include="ORM\VertexConnectorMap.cs" />
-    <Compile Include="ORM\BaseEdgeMap.cs" />
-    <Compile Include="ORM\EdgeTypeMap.cs" />
-    <Compile Include="ORM\BaseEffectorMap.cs" />
-    <Compile Include="ORM\VertexCellEffectorMessageMap.cs" />
+    <Compile Include="Graph\CellEffector.cs" />
+    <Compile Include="Graph\EffectorMessage.cs" />
+    <Compile Include="ORM\EnumMappingConvention.cs" />
+    <Compile Include="ORM\StoreConfiguration.cs" />
     <Compile Include="ORM\BaseEnumMap.cs" />
-    <Compile Include="ORM\BaseVertexMap.cs" />
-    <Compile Include="ORM\VertexTypeMap.cs" />
     <Compile Include="UI\Behaviors\CommandRelay.cs" />
     <Compile Include="UI\Behaviors\DragAndDrop\DefaultDragHandler.cs" />
     <Compile Include="UI\Behaviors\DragAndDrop\DefaultDropHandler.cs" />
       <DependentUpon>Events.tt</DependentUpon>
     </Compile>
     <Compile Include="Events\ObservableEvent.cs" />
-    <Compile Include="Graph\CellType.cs" />
     <Compile Include="Graph\SessionExtensions.cs" />
-    <Compile Include="Graph\DefinitionComponent.cs" />
-    <Compile Include="Graph\EdgeConnection.cs" />
-    <Compile Include="Graph\EdgeAssociation.cs" />
-    <Compile Include="Graph\CellCategory.cs" />
-    <Compile Include="Graph\EdgeType.cs" />
-    <Compile Include="Graph\BaseEdge.cs" />
-    <Compile Include="Graph\DefinitionConnector.cs" />
-    <Compile Include="Graph\VertexConnector.cs" />
-    <Compile Include="Graph\BaseVertexCell.cs" />
+    <Compile Include="Graph\Component.cs" />
+    <Compile Include="Graph\Connection.cs" />
+    <Compile Include="Graph\Association.cs" />
+    <Compile Include="Graph\Edge.cs" />
+    <Compile Include="Graph\Connector.cs" />
+    <Compile Include="Graph\ConnectorVertex.cs" />
+    <Compile Include="Graph\Cell.cs" />
     <Compile Include="Graph\BaseMappableEnum.cs" />
-    <Compile Include="Graph\BaseVertex.cs" />
+    <Compile Include="Graph\Vertex.cs" />
     <Compile Include="Graph\IVertex.cs" />
-    <Compile Include="Graph\VertexComponent.cs" />
-    <Compile Include="Graph\VertexType.cs" />
+    <Compile Include="Graph\ComponentVertex.cs" />
     <Compile Include="ORM\SessionHelper.cs" />
     <Compile Include="ShellViewModel.cs" />
     <Compile Include="UI\VisualTreeExtensions.cs" />

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Association.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using QuickGraph;
+
+namespace Composer.Graph
+{
+	public class Association : Edge
+	{
+		public Association() : base()
+		{ }
+
+		public Association(Vertex from, Vertex to)
+			: base(from, to)
+		{ }
+
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/BaseEdge.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using QuickGraph;
-
-namespace Composer.Graph
-{
-	public class BaseEdge : IEdge<BaseVertex>
-	{
-		private Edge<BaseVertex> _innerEdge;
-
-		public static readonly DefaultVertex DefaultFromVertex = new DefaultVertex();
-		public static readonly DefaultVertex DefaultToVertex = new DefaultVertex();
-
-		public BaseEdge()
-			: this(DefaultFromVertex, DefaultToVertex)
-		{ }
-
-		public BaseEdge(BaseVertex from, BaseVertex to)
-		{
-			this._innerEdge = new Edge<BaseVertex>(from, to);
-		}
-
-		public virtual int Id { get; private set; }
-
-		public virtual EdgeType EdgeType { get; private set; }
-
-		public virtual BaseVertex Source
-		{
-			get { return (BaseVertex)_innerEdge.Source; }
-			set { _innerEdge = new Edge<BaseVertex>(value, _innerEdge.Target); }
-		}
-
-		public virtual BaseVertex Target
-		{
-			get { return (BaseVertex)_innerEdge.Target; }
-			set { _innerEdge = new Edge<BaseVertex>(_innerEdge.Source, value); }
-		}
-
-
-		#region Nested Types
-	
-		/// <summary>
-		/// Used as a placeholder so that we can have a parameterless constructor
-		/// </summary>
-		public class DefaultVertex : BaseVertex
-		{
-		}
-
-		#endregion Nested Types
-
-		#region Inner Methods
-
-		BaseVertex IEdge<BaseVertex>.Source
-		{
-			get { return _innerEdge.Source; }
-		}
-
-		BaseVertex IEdge<BaseVertex>.Target
-		{
-			get { return _innerEdge.Target; }
-		}
-
-		#endregion Inner Methods
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/BaseVertex.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Diagnostics;
-
-namespace Composer.Graph
-{
-	public abstract class BaseVertex : IVertex
-	{
-
-		public BaseVertex()
-		{
-			Value = "An Element";
-		}
-
-		#region misc
-
-		public virtual string Value { get; set; }
-
-		public virtual ElementShape Shape
-		{
-			get
-			{
-				return ElementShape.Elliptical;
-			}
-		}
-
-		#endregion
-
-		public virtual int Id { get; private set; }
-
-		[Browsable(false)]
-		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
-		[EditorBrowsable(EditorBrowsableState.Never)]
-		public virtual VertexType VertexType { get; protected set; }
-
-		public virtual DefinitionComponent ParentComponentDefinition { get; set; }
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/BaseVertexCell.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public abstract class BaseVertexCell : BaseVertex
-	{
-		public BaseVertexCell()
-		{
-			base.VertexType = VertexType.Cell;
-		}
-
-		public virtual CellType CellType { get; set; }
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/BaseVertexCellEffector.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public abstract class BaseVertexCellEffector : BaseVertexCell
-	{
-		public BaseVertexCellEffector()
-		{
-			ActivationCount = 1;
-		}
-
-		public virtual int ActivationCount { get; set; }
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Cell.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Composer.Graph
+{
+	public abstract class Cell : Vertex
+	{
+		public Cell()
+		{
+		}
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/CellCategory.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	[Flags]
-	public enum CellCategory
-	{
-		Sensor = 1,
-		Effector = 2,
-		Hybrid = Sensor | Effector
-	}
-
-	public class MappableCellCategory : BaseMappableEnum
-	{
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/CellEffector.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Composer.Graph
+{
+	public abstract class CellEffector : Cell
+	{
+		public CellEffector()
+		{
+			ActivationCount = 1;
+		}
+
+		public virtual int ActivationCount { get; set; }
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/CellFactory.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public static class CellFactory
-	{
-		public static BaseVertexCell CreateCell(CellType cellType)
-		{
-			switch (cellType)
-			{
-				case CellType.Effector_Message:
-					return new VertexCellEffectorMessage();
-			}
-			return null;
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/CellType.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public enum CellType
-	{
-		Effector_Message = 1
-	}
-
-	public class MappableCellType : BaseMappableEnum
-	{
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Component.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using QuickGraph;
+
+using Composer.Common;
+
+namespace Composer.Graph
+{
+	public interface IMyGraph<TVertex, TEdge> : 
+		IEdgeListAndIncidenceGraph<TVertex, TEdge>, IMutableBidirectionalGraph<TVertex, TEdge>, 
+		IBidirectionalGraph<TVertex, TEdge>, IMutableVertexAndEdgeListGraph<TVertex, TEdge>, 
+		IMutableVertexListGraph<TVertex, TEdge>, IMutableIncidenceGraph<TVertex, TEdge>, 
+		IMutableVertexAndEdgeSet<TVertex, TEdge>, IMutableVertexSet<TVertex>,
+		IMutableEdgeListGraph<TVertex, TEdge>, IMutableGraph<TVertex, TEdge>,
+		IVertexAndEdgeListGraph<TVertex, TEdge>, IVertexListGraph<TVertex, TEdge>,
+		IIncidenceGraph<TVertex, TEdge>, IImplicitGraph<TVertex, TEdge>,
+		IEdgeListGraph<TVertex, TEdge>, IGraph<TVertex, TEdge>, IEdgeSet<TVertex, TEdge>, 
+		IVertexSet<TVertex>, IImplicitVertexSet<TVertex>, ICloneable 
+		where TEdge : IEdge<TVertex>
+	{ }
+
+
+	public class Component : IMyGraph<Vertex, Edge>
+	{
+		private BidirectionalGraph<Vertex, Edge> _innerGraph;
+
+		public Component()
+		{
+			_innerGraph = new BidirectionalGraph<Vertex, Edge>();
+			this.ChildVertices = new List<Vertex>();
+		}
+
+		public virtual Edge Connect(Vertex from, Vertex to)
+		{
+			var connection = new Edge(from, to);
+			_innerGraph.AddEdge(connection);
+			return connection;
+		}
+
+		public virtual Guid Id { get; set; }
+		public virtual string Name { get; set; }
+		public virtual string Description { get; set; }
+
+		public virtual IList<Vertex> ChildVertices { get; private set; }
+
+		
+
+		#region Inner Methods
+
+		bool IGraph<Vertex, Edge>.AllowParallelEdges
+		{
+			get { return _innerGraph.AllowParallelEdges; }
+		}
+
+		bool IGraph<Vertex, Edge>.IsDirected
+		{
+			get { return _innerGraph.IsDirected; }
+		}
+
+		bool IEdgeSet<Vertex, Edge>.ContainsEdge(Edge edge)
+		{
+			return _innerGraph.ContainsEdge(edge);
+		}
+
+		int IEdgeSet<Vertex, Edge>.EdgeCount
+		{
+			get { return _innerGraph.EdgeCount; }
+		}
+
+		IEnumerable<Edge> IEdgeSet<Vertex, Edge>.Edges
+		{
+			get { return _innerGraph.Edges; }
+		}
+
+		bool IEdgeSet<Vertex, Edge>.IsEdgesEmpty
+		{
+			get { return _innerGraph.IsEdgesEmpty; }
+		}
+
+		bool IVertexSet<Vertex>.IsVerticesEmpty
+		{
+			get { return _innerGraph.IsVerticesEmpty; }
+		}
+
+		int IVertexSet<Vertex>.VertexCount
+		{
+			get { return _innerGraph.VertexCount; }
+		}
+
+		IEnumerable<Vertex> IVertexSet<Vertex>.Vertices
+		{
+			get { return _innerGraph.Vertices; }
+		}
+
+		bool IImplicitVertexSet<Vertex>.ContainsVertex(Vertex vertex)
+		{
+			return _innerGraph.ContainsVertex(vertex);
+		}
+
+		bool IIncidenceGraph<Vertex, Edge>.ContainsEdge(Vertex source, Vertex target)
+		{
+			return _innerGraph.ContainsEdge(source, target);
+		}
+
+		bool IIncidenceGraph<Vertex, Edge>.TryGetEdge(Vertex source, Vertex target, out Edge edge)
+		{
+			return _innerGraph.TryGetEdge(source, target, out edge);
+		}
+
+		bool IIncidenceGraph<Vertex, Edge>.TryGetEdges(Vertex source, Vertex target, out IEnumerable<Edge> edges)
+		{
+			return _innerGraph.TryGetEdges(source, target, out edges);
+		}
+
+		bool IImplicitGraph<Vertex, Edge>.IsOutEdgesEmpty(Vertex v)
+		{
+			return _innerGraph.IsOutEdgesEmpty(v);
+		}
+
+		int IImplicitGraph<Vertex, Edge>.OutDegree(Vertex v)
+		{
+			return _innerGraph.OutDegree(v);
+		}
+
+		Edge IImplicitGraph<Vertex, Edge>.OutEdge(Vertex v, int index)
+		{
+			return _innerGraph.OutEdge(v, index);
+		}
+
+		IEnumerable<Edge> IImplicitGraph<Vertex, Edge>.OutEdges(Vertex v)
+		{
+			return _innerGraph.OutEdges(v);
+		}
+
+		bool IImplicitGraph<Vertex, Edge>.TryGetOutEdges(Vertex v, out IEnumerable<Edge> edges)
+		{
+			return _innerGraph.TryGetOutEdges(v, out edges);
+		}
+
+		void IMutableBidirectionalGraph<Vertex, Edge>.ClearEdges(Vertex v)
+		{
+			_innerGraph.ClearEdges(v);
+		}
+
+		void IMutableBidirectionalGraph<Vertex, Edge>.ClearInEdges(Vertex v)
+		{
+			_innerGraph.ClearInEdges(v);
+		}
+
+		int IMutableBidirectionalGraph<Vertex, Edge>.RemoveInEdgeIf(Vertex v, EdgePredicate<Vertex, Edge> edgePredicate)
+		{
+			return _innerGraph.RemoveInEdgeIf(v, edgePredicate);
+		}
+
+		void IMutableIncidenceGraph<Vertex, Edge>.ClearOutEdges(Vertex v)
+		{
+			_innerGraph.ClearOutEdges(v);
+		}
+
+		int IMutableIncidenceGraph<Vertex, Edge>.RemoveOutEdgeIf(Vertex v, EdgePredicate<Vertex, Edge> predicate)
+		{
+			return _innerGraph.RemoveOutEdgeIf(v, predicate);
+		}
+
+		void IMutableIncidenceGraph<Vertex, Edge>.TrimEdgeExcess()
+		{
+			_innerGraph.TrimEdgeExcess();
+		}
+
+		void IMutableGraph<Vertex, Edge>.Clear()
+		{
+			_innerGraph.Clear();
+		}
+
+		public virtual bool AddVertex(Vertex v)
+		{
+			v.ParentComponentDefinition = this;
+			return _innerGraph.AddVertex(v);
+		}
+
+		public virtual int AddVertexRange(IEnumerable<Vertex> vertices)
+		{
+			vertices.Apply(v => v.ParentComponentDefinition = this);
+			return _innerGraph.AddVertexRange(vertices);
+		}
+
+		bool IMutableVertexSet<Vertex>.RemoveVertex(Vertex v)
+		{
+			return _innerGraph.RemoveVertex(v);
+		}
+
+		int IMutableVertexSet<Vertex>.RemoveVertexIf(VertexPredicate<Vertex> pred)
+		{
+			return _innerGraph.RemoveVertexIf(pred);
+		}
+
+		event VertexAction<Vertex> IMutableVertexSet<Vertex>.VertexAdded
+		{
+			add { _innerGraph.VertexAdded += value; }
+			remove { _innerGraph.VertexAdded -= value; }
+		}
+
+		event VertexAction<Vertex> IMutableVertexSet<Vertex>.VertexRemoved
+		{
+			add { _innerGraph.VertexRemoved += value; }
+			remove { _innerGraph.VertexRemoved -= value; }
+		}
+
+		bool IMutableVertexAndEdgeSet<Vertex, Edge>.AddVerticesAndEdge(Edge edge)
+		{
+			return _innerGraph.AddVerticesAndEdge(edge);
+		}
+
+		int IMutableVertexAndEdgeSet<Vertex, Edge>.AddVerticesAndEdgeRange(IEnumerable<Edge> edges)
+		{
+			return _innerGraph.AddVerticesAndEdgeRange(edges);
+		}
+
+		bool IMutableEdgeListGraph<Vertex, Edge>.AddEdge(Edge edge)
+		{
+			return _innerGraph.AddEdge(edge);
+		}
+
+		int IMutableEdgeListGraph<Vertex, Edge>.AddEdgeRange(IEnumerable<Edge> edges)
+		{
+			return _innerGraph.AddEdgeRange(edges);
+		}
+
+		event EdgeAction<Vertex, Edge> IMutableEdgeListGraph<Vertex, Edge>.EdgeAdded
+		{
+			add { _innerGraph.EdgeAdded += value; }
+			remove { _innerGraph.EdgeAdded -= value; }
+		}
+
+		event EdgeAction<Vertex, Edge> IMutableEdgeListGraph<Vertex, Edge>.EdgeRemoved
+		{
+			add { _innerGraph.EdgeRemoved += value; }
+			remove { _innerGraph.EdgeRemoved -= value; }
+		}
+
+		bool IMutableEdgeListGraph<Vertex, Edge>.RemoveEdge(Edge edge)
+		{
+			return _innerGraph.RemoveEdge(edge);
+		}
+
+		int IMutableEdgeListGraph<Vertex, Edge>.RemoveEdgeIf(EdgePredicate<Vertex, Edge> predicate)
+		{
+			return _innerGraph.RemoveEdgeIf(predicate);
+		}
+
+		int IBidirectionalGraph<Vertex, Edge>.Degree(Vertex v)
+		{
+			return _innerGraph.Degree(v);
+		}
+
+		int IBidirectionalGraph<Vertex, Edge>.InDegree(Vertex v)
+		{
+			return _innerGraph.InDegree(v);
+		}
+
+		Edge IBidirectionalGraph<Vertex, Edge>.InEdge(Vertex v, int index)
+		{
+			return _innerGraph.InEdge(v, index);
+		}
+
+		IEnumerable<Edge> IBidirectionalGraph<Vertex, Edge>.InEdges(Vertex v)
+		{
+			return _innerGraph.InEdges(v);
+		}
+
+		bool IBidirectionalGraph<Vertex, Edge>.IsInEdgesEmpty(Vertex v)
+		{
+			return _innerGraph.IsInEdgesEmpty(v);
+		}
+
+		bool IBidirectionalGraph<Vertex, Edge>.TryGetInEdges(Vertex v, out IEnumerable<Edge> edges)
+		{
+			return _innerGraph.TryGetInEdges(v, out edges);
+		}
+
+		object ICloneable.Clone()
+		{
+			return _innerGraph.Clone();
+		}
+
+		#endregion Inner Methods
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/ComponentVertex.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Composer.Graph
+{
+	public class ComponentVertex : Vertex
+	{
+		public ComponentVertex()
+		{
+
+		}
+
+		public virtual Component ComponentDefinition { get; set; }
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Connection.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using QuickGraph;
+
+namespace Composer.Graph
+{
+	public class Connection : Edge
+	{
+		public Connection() : base()
+		{ }
+
+		public Connection(Vertex from, Vertex to)
+			: base(from, to)
+		{ }
+
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Connector.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Composer.Graph
+{
+	public class Connector
+	{
+
+		public virtual int Id { get; private set; }
+		public virtual string Name { get; set; }
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/ConnectorVertex.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Composer.Graph
+{
+	public class ConnectorVertex : Vertex
+	{
+		public ConnectorVertex()
+		{
+		}
+
+		public virtual Connector ConnectorDefinition { get; set; }
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/DefinitionComponent.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using QuickGraph;
-
-using Composer.Common;
-
-namespace Composer.Graph
-{
-	public interface IMyGraph<TVertex, TEdge> : 
-		IEdgeListAndIncidenceGraph<TVertex, TEdge>, IMutableBidirectionalGraph<TVertex, TEdge>, 
-		IBidirectionalGraph<TVertex, TEdge>, IMutableVertexAndEdgeListGraph<TVertex, TEdge>, 
-		IMutableVertexListGraph<TVertex, TEdge>, IMutableIncidenceGraph<TVertex, TEdge>, 
-		IMutableVertexAndEdgeSet<TVertex, TEdge>, IMutableVertexSet<TVertex>,
-		IMutableEdgeListGraph<TVertex, TEdge>, IMutableGraph<TVertex, TEdge>,
-		IVertexAndEdgeListGraph<TVertex, TEdge>, IVertexListGraph<TVertex, TEdge>,
-		IIncidenceGraph<TVertex, TEdge>, IImplicitGraph<TVertex, TEdge>,
-		IEdgeListGraph<TVertex, TEdge>, IGraph<TVertex, TEdge>, IEdgeSet<TVertex, TEdge>, 
-		IVertexSet<TVertex>, IImplicitVertexSet<TVertex>, ICloneable 
-		where TEdge : IEdge<TVertex>
-	{ }
-
-
-	public class DefinitionComponent : IMyGraph<BaseVertex, BaseEdge>
-	{
-		private BidirectionalGraph<BaseVertex, BaseEdge> _innerGraph;
-
-		public DefinitionComponent()
-		{
-			_innerGraph = new BidirectionalGraph<BaseVertex, BaseEdge>();
-			this.ChildVertices = new List<BaseVertex>();
-		}
-
-		public virtual BaseEdge Connect(BaseVertex from, BaseVertex to)
-		{
-			var connection = new BaseEdge(from, to);
-			_innerGraph.AddEdge(connection);
-			return connection;
-		}
-
-		public virtual Guid Id { get; set; }
-		public virtual string Name { get; set; }
-		public virtual string Description { get; set; }
-
-		public virtual IList<BaseVertex> ChildVertices { get; private set; }
-
-		
-
-		#region Inner Methods
-
-		bool IGraph<BaseVertex, BaseEdge>.AllowParallelEdges
-		{
-			get { return _innerGraph.AllowParallelEdges; }
-		}
-
-		bool IGraph<BaseVertex, BaseEdge>.IsDirected
-		{
-			get { return _innerGraph.IsDirected; }
-		}
-
-		bool IEdgeSet<BaseVertex, BaseEdge>.ContainsEdge(BaseEdge edge)
-		{
-			return _innerGraph.ContainsEdge(edge);
-		}
-
-		int IEdgeSet<BaseVertex, BaseEdge>.EdgeCount
-		{
-			get { return _innerGraph.EdgeCount; }
-		}
-
-		IEnumerable<BaseEdge> IEdgeSet<BaseVertex, BaseEdge>.Edges
-		{
-			get { return _innerGraph.Edges; }
-		}
-
-		bool IEdgeSet<BaseVertex, BaseEdge>.IsEdgesEmpty
-		{
-			get { return _innerGraph.IsEdgesEmpty; }
-		}
-
-		bool IVertexSet<BaseVertex>.IsVerticesEmpty
-		{
-			get { return _innerGraph.IsVerticesEmpty; }
-		}
-
-		int IVertexSet<BaseVertex>.VertexCount
-		{
-			get { return _innerGraph.VertexCount; }
-		}
-
-		IEnumerable<BaseVertex> IVertexSet<BaseVertex>.Vertices
-		{
-			get { return _innerGraph.Vertices; }
-		}
-
-		bool IImplicitVertexSet<BaseVertex>.ContainsVertex(BaseVertex vertex)
-		{
-			return _innerGraph.ContainsVertex(vertex);
-		}
-
-		bool IIncidenceGraph<BaseVertex, BaseEdge>.ContainsEdge(BaseVertex source, BaseVertex target)
-		{
-			return _innerGraph.ContainsEdge(source, target);
-		}
-
-		bool IIncidenceGraph<BaseVertex, BaseEdge>.TryGetEdge(BaseVertex source, BaseVertex target, out BaseEdge edge)
-		{
-			return _innerGraph.TryGetEdge(source, target, out edge);
-		}
-
-		bool IIncidenceGraph<BaseVertex, BaseEdge>.TryGetEdges(BaseVertex source, BaseVertex target, out IEnumerable<BaseEdge> edges)
-		{
-			return _innerGraph.TryGetEdges(source, target, out edges);
-		}
-
-		bool IImplicitGraph<BaseVertex, BaseEdge>.IsOutEdgesEmpty(BaseVertex v)
-		{
-			return _innerGraph.IsOutEdgesEmpty(v);
-		}
-
-		int IImplicitGraph<BaseVertex, BaseEdge>.OutDegree(BaseVertex v)
-		{
-			return _innerGraph.OutDegree(v);
-		}
-
-		BaseEdge IImplicitGraph<BaseVertex, BaseEdge>.OutEdge(BaseVertex v, int index)
-		{
-			return _innerGraph.OutEdge(v, index);
-		}
-
-		IEnumerable<BaseEdge> IImplicitGraph<BaseVertex, BaseEdge>.OutEdges(BaseVertex v)
-		{
-			return _innerGraph.OutEdges(v);
-		}
-
-		bool IImplicitGraph<BaseVertex, BaseEdge>.TryGetOutEdges(BaseVertex v, out IEnumerable<BaseEdge> edges)
-		{
-			return _innerGraph.TryGetOutEdges(v, out edges);
-		}
-
-		void IMutableBidirectionalGraph<BaseVertex, BaseEdge>.ClearEdges(BaseVertex v)
-		{
-			_innerGraph.ClearEdges(v);
-		}
-
-		void IMutableBidirectionalGraph<BaseVertex, BaseEdge>.ClearInEdges(BaseVertex v)
-		{
-			_innerGraph.ClearInEdges(v);
-		}
-
-		int IMutableBidirectionalGraph<BaseVertex, BaseEdge>.RemoveInEdgeIf(BaseVertex v, EdgePredicate<BaseVertex, BaseEdge> edgePredicate)
-		{
-			return _innerGraph.RemoveInEdgeIf(v, edgePredicate);
-		}
-
-		void IMutableIncidenceGraph<BaseVertex, BaseEdge>.ClearOutEdges(BaseVertex v)
-		{
-			_innerGraph.ClearOutEdges(v);
-		}
-
-		int IMutableIncidenceGraph<BaseVertex, BaseEdge>.RemoveOutEdgeIf(BaseVertex v, EdgePredicate<BaseVertex, BaseEdge> predicate)
-		{
-			return _innerGraph.RemoveOutEdgeIf(v, predicate);
-		}
-
-		void IMutableIncidenceGraph<BaseVertex, BaseEdge>.TrimEdgeExcess()
-		{
-			_innerGraph.TrimEdgeExcess();
-		}
-
-		void IMutableGraph<BaseVertex, BaseEdge>.Clear()
-		{
-			_innerGraph.Clear();
-		}
-
-		public virtual bool AddVertex(BaseVertex v)
-		{
-			v.ParentComponentDefinition = this;
-			return _innerGraph.AddVertex(v);
-		}
-
-		public virtual int AddVertexRange(IEnumerable<BaseVertex> vertices)
-		{
-			vertices.Apply(v => v.ParentComponentDefinition = this);
-			return _innerGraph.AddVertexRange(vertices);
-		}
-
-		bool IMutableVertexSet<BaseVertex>.RemoveVertex(BaseVertex v)
-		{
-			return _innerGraph.RemoveVertex(v);
-		}
-
-		int IMutableVertexSet<BaseVertex>.RemoveVertexIf(VertexPredicate<BaseVertex> pred)
-		{
-			return _innerGraph.RemoveVertexIf(pred);
-		}
-
-		event VertexAction<BaseVertex> IMutableVertexSet<BaseVertex>.VertexAdded
-		{
-			add { _innerGraph.VertexAdded += value; }
-			remove { _innerGraph.VertexAdded -= value; }
-		}
-
-		event VertexAction<BaseVertex> IMutableVertexSet<BaseVertex>.VertexRemoved
-		{
-			add { _innerGraph.VertexRemoved += value; }
-			remove { _innerGraph.VertexRemoved -= value; }
-		}
-
-		bool IMutableVertexAndEdgeSet<BaseVertex, BaseEdge>.AddVerticesAndEdge(BaseEdge edge)
-		{
-			return _innerGraph.AddVerticesAndEdge(edge);
-		}
-
-		int IMutableVertexAndEdgeSet<BaseVertex, BaseEdge>.AddVerticesAndEdgeRange(IEnumerable<BaseEdge> edges)
-		{
-			return _innerGraph.AddVerticesAndEdgeRange(edges);
-		}
-
-		bool IMutableEdgeListGraph<BaseVertex, BaseEdge>.AddEdge(BaseEdge edge)
-		{
-			return _innerGraph.AddEdge(edge);
-		}
-
-		int IMutableEdgeListGraph<BaseVertex, BaseEdge>.AddEdgeRange(IEnumerable<BaseEdge> edges)
-		{
-			return _innerGraph.AddEdgeRange(edges);
-		}
-
-		event EdgeAction<BaseVertex, BaseEdge> IMutableEdgeListGraph<BaseVertex, BaseEdge>.EdgeAdded
-		{
-			add { _innerGraph.EdgeAdded += value; }
-			remove { _innerGraph.EdgeAdded -= value; }
-		}
-
-		event EdgeAction<BaseVertex, BaseEdge> IMutableEdgeListGraph<BaseVertex, BaseEdge>.EdgeRemoved
-		{
-			add { _innerGraph.EdgeRemoved += value; }
-			remove { _innerGraph.EdgeRemoved -= value; }
-		}
-
-		bool IMutableEdgeListGraph<BaseVertex, BaseEdge>.RemoveEdge(BaseEdge edge)
-		{
-			return _innerGraph.RemoveEdge(edge);
-		}
-
-		int IMutableEdgeListGraph<BaseVertex, BaseEdge>.RemoveEdgeIf(EdgePredicate<BaseVertex, BaseEdge> predicate)
-		{
-			return _innerGraph.RemoveEdgeIf(predicate);
-		}
-
-		int IBidirectionalGraph<BaseVertex, BaseEdge>.Degree(BaseVertex v)
-		{
-			return _innerGraph.Degree(v);
-		}
-
-		int IBidirectionalGraph<BaseVertex, BaseEdge>.InDegree(BaseVertex v)
-		{
-			return _innerGraph.InDegree(v);
-		}
-
-		BaseEdge IBidirectionalGraph<BaseVertex, BaseEdge>.InEdge(BaseVertex v, int index)
-		{
-			return _innerGraph.InEdge(v, index);
-		}
-
-		IEnumerable<BaseEdge> IBidirectionalGraph<BaseVertex, BaseEdge>.InEdges(BaseVertex v)
-		{
-			return _innerGraph.InEdges(v);
-		}
-
-		bool IBidirectionalGraph<BaseVertex, BaseEdge>.IsInEdgesEmpty(BaseVertex v)
-		{
-			return _innerGraph.IsInEdgesEmpty(v);
-		}
-
-		bool IBidirectionalGraph<BaseVertex, BaseEdge>.TryGetInEdges(BaseVertex v, out IEnumerable<BaseEdge> edges)
-		{
-			return _innerGraph.TryGetInEdges(v, out edges);
-		}
-
-		object ICloneable.Clone()
-		{
-			return _innerGraph.Clone();
-		}
-
-		#endregion Inner Methods
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/DefinitionConnector.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public class DefinitionConnector
-	{
-
-		public virtual int Id { get; private set; }
-		public virtual string Name { get; set; }
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Edge.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using QuickGraph;
+
+namespace Composer.Graph
+{
+	public class Edge : IEdge<Vertex>
+	{
+		private Edge<Vertex> _innerEdge;
+
+		public static readonly DefaultVertex DefaultFromVertex = new DefaultVertex();
+		public static readonly DefaultVertex DefaultToVertex = new DefaultVertex();
+
+		public Edge()
+			: this(DefaultFromVertex, DefaultToVertex)
+		{ }
+
+		public Edge(Vertex from, Vertex to)
+		{
+			this._innerEdge = new Edge<Vertex>(from, to);
+		}
+
+		public virtual int Id { get; private set; }
+
+		public virtual Vertex Source
+		{
+			get { return (Vertex)_innerEdge.Source; }
+			set { _innerEdge = new Edge<Vertex>(value, _innerEdge.Target); }
+		}
+
+		public virtual Vertex Target
+		{
+			get { return (Vertex)_innerEdge.Target; }
+			set { _innerEdge = new Edge<Vertex>(_innerEdge.Source, value); }
+		}
+
+
+		#region Nested Types
+	
+		/// <summary>
+		/// Used as a placeholder so that we can have a parameterless constructor
+		/// </summary>
+		public class DefaultVertex : Vertex
+		{
+		}
+
+		#endregion Nested Types
+
+		#region Inner Methods
+
+		Vertex IEdge<Vertex>.Source
+		{
+			get { return _innerEdge.Source; }
+		}
+
+		Vertex IEdge<Vertex>.Target
+		{
+			get { return _innerEdge.Target; }
+		}
+
+		#endregion Inner Methods
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/EdgeAssociation.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using QuickGraph;
-
-namespace Composer.Graph
-{
-	public class EdgeAssociation : BaseEdge
-	{
-		public EdgeAssociation() : base()
-		{ }
-
-		public EdgeAssociation(BaseVertex from, BaseVertex to)
-			: base(from, to)
-		{ }
-
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/EdgeConnection.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using QuickGraph;
-
-namespace Composer.Graph
-{
-	public class EdgeConnection : BaseEdge
-	{
-		public EdgeConnection() : base()
-		{ }
-
-		public EdgeConnection(BaseVertex from, BaseVertex to)
-			: base(from, to)
-		{ }
-
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/EdgeType.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public enum EdgeType
-	{
-		Connection = 0,
-		Association = 1
-	}
-
-	public class MappableEdgeType : BaseMappableEnum
-	{
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/EffectorMessage.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Composer.Graph
+{
+	public class EffectorMessage : CellEffector
+	{
+		public EffectorMessage()
+		{
+		}
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/IVertex.cs

 	{
 		ElementShape Shape { get; }
 
-		DefinitionComponent ParentComponentDefinition { get; set; }
+		Component ParentComponentDefinition { get; set; }
 	}
 }

UserProjects/sprucely/CSharp/Composer/Composer/Graph/Vertex.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.ComponentModel;
+using System.Diagnostics;
+
+namespace Composer.Graph
+{
+	public abstract class Vertex : IVertex
+	{
+
+		public Vertex()
+		{
+		}
+
+		#region misc
+
+		public virtual ElementShape Shape
+		{
+			get
+			{
+				return ElementShape.Elliptical;
+			}
+		}
+
+		#endregion
+
+		public virtual int Id { get; private set; }
+
+		public virtual Component ParentComponentDefinition { get; set; }
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/VertexCellEffectorMessage.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public class VertexCellEffectorMessage : BaseVertexCellEffector
-	{
-		public VertexCellEffectorMessage()
-		{
-			base.CellType = CellType.Effector_Message;
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/VertexComponent.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public class VertexComponent : BaseVertex
-	{
-		public VertexComponent()
-		{
-			base.VertexType = VertexType.Component;
-		}
-
-		public virtual DefinitionComponent ComponentDefinition { get; set; }
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/VertexConnector.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public class VertexConnector : BaseVertex
-	{
-		public VertexConnector()
-		{
-			base.VertexType = VertexType.Connector;
-		}
-
-		public virtual DefinitionConnector ConnectorDefinition { get; set; }
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/VertexType.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public enum VertexType
-	{
-		Cell = 1,
-		Component = 2,
-		Connector=3
-	}
-
-	public class MappableVertexType : BaseMappableEnum
-	{
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/BaseCellVertexMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Composer.Graph;
-using FluentNHibernate.Mapping;
-
-namespace Composer.ORM
-{
-	public abstract class BaseCellVertexMap<T> : SubclassMap<T>
-		where T : BaseVertexCell
-	{
-		public BaseCellVertexMap()
-		{
-			KeyColumn("Id_Vertex");
-			DiscriminatorValue((int)VertexType.Cell);
-
-			Map(x => x.CellType)
-				.Column("Id_CellType")
-				.CustomType<int>()
-				.Not.Nullable();
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/BaseEdgeMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class BaseEdgeMap : ClassMap<BaseEdge>
-	{
-		public BaseEdgeMap()
-		{
-			Cache.ReadWrite();
-			Table("Edge");
-			Id(x => x.Id);
-			Map(x => x.EdgeType)
-				.Column("Id_EdgeType")
-				.CustomType<int>()
-				.Not.Nullable();
-
-			References(x => x.Source)
-				.Not.Nullable()
-				.Column("Id_Vertex_Source");
-			References(x => x.Target)
-				.Not.Nullable()
-				.Column("Id_Vertex_Target");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/BaseEffectorMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public abstract class BaseEffectorMap<T> : BaseCellVertexMap<T>
-		where T : BaseVertexCellEffector
-	{
-		public BaseEffectorMap()
-		{
-			Map(x => x.ActivationCount)
-				.Not.Nullable();
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/BaseVertexMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class BaseVertexMap : ClassMap<BaseVertex>
-	{
-		public BaseVertexMap()
-		{
-			Cache.ReadWrite();
-			Table("Vertex");
-			Id(x => x.Id);
-			Map(x => x.VertexType)
-				.Column("Id_VertexType")
-				.CustomType<int>()
-				.Not.Nullable();
-
-			References(x => x.ParentComponentDefinition)
-				.Not.Nullable()
-				.Column("Id_Definition_ParentComponent");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/CellCategoryMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class CellCategoryMap : BaseEnumMap<MappableCellCategory>
-	{
-		public CellCategoryMap()
-		{
-			Table("CellCategory_def");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/CellTypeMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class CellTypeMap : BaseEnumMap<MappableCellType>
-	{
-		public CellTypeMap()
-		{
-			Table("CellType_def");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/DefinitionComponentMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class DefinitionComponentMap : ClassMap<DefinitionComponent>
-	{
-		public DefinitionComponentMap()
-		{
-			Cache.ReadWrite();
-			Table("Definition_Component");
-			Id(x => x.Id);
-			Map(x => x.Name)
-				.Unique()
-				.Not.Nullable()
-				.CustomSqlType("VARCHAR(100)");
-			Map(x => x.Description)
-				.Unique()
-				.Not.Nullable()
-				.CustomSqlType("VARCHAR(200)");
-
-			HasMany(x => x.ChildVertices)
-				.KeyColumn("Id_Definition_ParentComponent");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/DefinitionConnectorMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class DefinitionConnectorMap : ClassMap<DefinitionConnector>
-	{
-		public DefinitionConnectorMap()
-		{
-			Cache.ReadWrite();
-			Table("Definition_Connector");
-			Id(x => x.Id);
-			Map(x => x.Name)
-				.Unique()
-				.Not.Nullable()
-				.CustomSqlType("VARCHAR(100)");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/EdgeAssociationMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class EdgeAssociationMap : SubclassMap<EdgeAssociation>
-	{
-		public EdgeAssociationMap()
-		{
-			Table("Edge_Association");
-			KeyColumn("Id_Edge");
-			DiscriminatorValue(1);
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/EdgeConnectionMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class EdgeConnectionMap : SubclassMap<EdgeConnection>
-	{
-		public EdgeConnectionMap()
-		{
-			Table("Edge_Connection");
-			KeyColumn("Id_Edge");
-			DiscriminatorValue(0);
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/EdgeTypeMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class EdgeTypeMap : BaseEnumMap<MappableEdgeType>
-	{
-		public EdgeTypeMap()
-		{
-			Table("EdgeType_def");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/EnumMappingConvention.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using FluentNHibernate.Conventions;
+using FluentNHibernate.Conventions.AcceptanceCriteria;
+using FluentNHibernate.Conventions.Inspections;
+using FluentNHibernate.Conventions.Instances;
+
+namespace Composer.ORM
+{
+	public class EnumMappingConvention : IUserTypeConvention
+	{
+		public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
+		{
+			criteria.Expect(x => x.Property.PropertyType.IsEnum);
+		}
+
+		public void Apply(IPropertyInstance target)
+		{
+			target.CustomType(target.Property.PropertyType);
+		}
+	}
+
+
+}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/SessionHelper.cs

 using NHibernate.Cfg;
 using NHibernate.Linq;
 using NHibernate.Tool.hbm2ddl;
+using FluentNHibernate.Automapping;
 
 namespace Composer.ORM
 {
 		{
 			bool schemaWasBuilt = false;
 
+			var mappingConfig = new StoreConfiguration();
+
 			var sessionFactory = Fluently.Configure()
 			  .Database(
 				SQLiteConfiguration.Standard
 			  )
 			  .Mappings(m =>
 				  {
-					  m.FluentMappings.AddFromAssemblyOf<BaseVertexCell>();
-					  m.FluentMappings.Add(typeof(VertexCellEffectorMessageMap));
+					  var model = AutoMap.AssemblyOf<Cell>(mappingConfig);
+					  model.IncludeBase<Vertex>();
+					  m.AutoMappings.Add(model);
+					  //m.FluentMappings.AddFromAssemblyOf<BaseVertexCell>();
+					  //m.FluentMappings.Add(typeof(VertexCellEffectorMessageMap));
 				  })
 			  .ExposeConfiguration(config => schemaWasBuilt = BuildSchema(config))
 			  .BuildSessionFactory();
 		{
 			using (var session = sessionFactory.OpenSession())
 			{
-				var rootComponent = new DefinitionComponent()
+				var rootComponent = new Component()
 				{
 					Id = Guid.NewGuid(),
 					Name = "Root",
 					Description = "Description of Root"
 				};
-				var cellVertex = CellFactory.CreateCell(CellType.Effector_Message);
+				var cellVertex = new EffectorMessage();
 				cellVertex.ParentComponentDefinition = rootComponent;
 				rootComponent.ChildVertices.Add(cellVertex);
 				session.Save(rootComponent);
 
 		private static void InitLookups(ISessionFactory sessionFactory)
 		{
-			using (var session = sessionFactory.OpenSession())
-			using (var tx = session.BeginTransaction())
-			{
-				foreach (var vt in TypeUtilities.GetEnumValues<VertexType>())
-				{
-					session.Save(new MappableVertexType { Id = (int)vt, Name = vt.ToString() });
-				}
+			//using (var session = sessionFactory.OpenSession())
+			//using (var tx = session.BeginTransaction())
+			//{
+			//    foreach (var vt in TypeUtilities.GetEnumValues<VertexType>())
+			//    {
+			//        session.Save(new MappableVertexType { Id = (int)vt, Name = vt.ToString() });
+			//    }
 
-				foreach (var et in TypeUtilities.GetEnumValues<EdgeType>())
-				{
-					session.Save(new MappableEdgeType { Id = (int)et, Name = et.ToString() });
-				}
+			//    foreach (var et in TypeUtilities.GetEnumValues<EdgeType>())
+			//    {
+			//        session.Save(new MappableEdgeType { Id = (int)et, Name = et.ToString() });
+			//    }
 
-				foreach (var cc in TypeUtilities.GetEnumValues<CellCategory>())
-				{
-					session.Save(new MappableCellCategory { Id = (int)cc, Name = cc.ToString() });
-				}
+			//    foreach (var cc in TypeUtilities.GetEnumValues<CellCategory>())
+			//    {
+			//        session.Save(new MappableCellCategory { Id = (int)cc, Name = cc.ToString() });
+			//    }
 
-				foreach (var ct in TypeUtilities.GetEnumValues<CellType>())
-				{
-					session.Save(new MappableCellType { Id = (int)ct, Name = ct.ToString() });
-				}
+			//    foreach (var ct in TypeUtilities.GetEnumValues<CellType>())
+			//    {
+			//        session.Save(new MappableCellType { Id = (int)ct, Name = ct.ToString() });
+			//    }
 	
-				tx.Commit();
-			}
+			//    tx.Commit();
+			//}
 		}
 
 		private static bool BuildSchema(Configuration config)

UserProjects/sprucely/CSharp/Composer/Composer/ORM/StoreConfiguration.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using FluentNHibernate.Automapping;
+using Composer.Graph;
+using System.Reflection;
+
+namespace Composer.ORM
+{
+	public class StoreConfiguration : DefaultAutomappingConfiguration
+	{
+		public override bool ShouldMap(Type type)
+		{
+			if (type.Namespace != "Composer.Graph")
+				return false;
+
+			if (type.IsEnum)
+				return false;
+
+			if (type.IsNested)
+				return false;
+
+			return true;
+		}
+
+		public override bool ShouldMap(FluentNHibernate.Member member)
+		{
+			if (member.IsProperty && !((PropertyInfo)member.MemberInfo).CanWrite)
+				return false;
+			return base.ShouldMap(member);
+		}
+
+		public override bool IsDiscriminated(Type type)
+		{
+			return true;
+			//return type.In(typeof(ClassOne), typeof(ClassTwo));
+		}
+		
+	}
+}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/VertexCellEffectorMessageMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	class VertexCellEffectorMessageMap : BaseEffectorMap<VertexCellEffectorMessage>
-	{
-		public VertexCellEffectorMessageMap()
-		{
-			Table("VertexEffectorMessage");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/VertexComponentMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class VertexComponentMap : SubclassMap<VertexComponent>
-	{
-		public VertexComponentMap()
-		{
-			Table("Vertex_Component");
-			KeyColumn("Id_Vertex");
-			DiscriminatorValue((int)VertexType.Component);
-			References(x => x.ComponentDefinition)
-				.Not.Nullable()
-				.Column("Id_Definition_Component");
-		}
-	}
-}

UserProjects/sprucely/CSharp/Composer/Composer/ORM/VertexConnectorMap.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public class VertexConnectorMap : SubclassMap<VertexConnector>
-	{
-		public VertexConnectorMap()