Commits

Anonymous committed 451ce53

Refactoring model names to a convention more conducive to many types of cell vertices. Separated mapping classes into individual files.

Comments (0)

Files changed (53)

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="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" />
     <Compile Include="Events\ObservableEvent.cs" />
     <Compile Include="Graph\CellType.cs" />
     <Compile Include="Graph\SessionExtensions.cs" />
-    <Compile Include="Graph\ComponentDefinition.cs" />
-    <Compile Include="Graph\ConnectionEdge.cs" />
-    <Compile Include="Graph\AssociationEdge.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\EdgeBase.cs" />
-    <Compile Include="Graph\ConnectorDefinition.cs" />
-    <Compile Include="Graph\ConnectorVertex.cs" />
-    <Compile Include="Graph\CellVertex.cs" />
-    <Compile Include="Graph\MappableEnumBase.cs" />
-    <Compile Include="Graph\VertexBase.cs" />
+    <Compile Include="Graph\BaseEdge.cs" />
+    <Compile Include="Graph\DefinitionConnector.cs" />
+    <Compile Include="Graph\VertexConnector.cs" />
+    <Compile Include="Graph\BaseVertexCell.cs" />
+    <Compile Include="Graph\BaseMappableEnum.cs" />
+    <Compile Include="Graph\BaseVertex.cs" />
     <Compile Include="Graph\IVertex.cs" />
-    <Compile Include="Graph\ComponentVertex.cs" />
+    <Compile Include="Graph\VertexComponent.cs" />
     <Compile Include="Graph\VertexType.cs" />
-    <Compile Include="ORM\Mappings.cs" />
     <Compile Include="ORM\SessionHelper.cs" />
     <Compile Include="ShellViewModel.cs" />
     <Compile Include="UI\VisualTreeExtensions.cs" />

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

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using QuickGraph;
-
-namespace Composer.Graph
-{
-	public class AssociationEdge : EdgeBase
-	{
-		public AssociationEdge() : base()
-		{ }
-
-		public AssociationEdge(VertexBase from, VertexBase 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/BaseMappableEnum.cs

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

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/CellCategory.cs

 		Hybrid = Sensor | Effector
 	}
 
-	public class MappableCellCategory : MappableEnumBase
+	public class MappableCellCategory : BaseMappableEnum
 	{
 	}
 }

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

 {
 	public enum CellType
 	{
-		Effector_Message = 0
+		Effector_Message = 1
 	}
 
-	public class MappableCellType : MappableEnumBase
+	public class MappableCellType : BaseMappableEnum
 	{
 	}
 }

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

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public class CellVertex : VertexBase
-	{
-		public CellVertex()
-		{
-			base.VertexType = VertexType.Cell;
-		}
-
-		public virtual CellType CellType { get; set; }
-	}
-
-	public class Effector : CellVertex
-	{
-		public Effector()
-		{
-			ActivationCount = 1;
-		}
-
-		public virtual int ActivationCount { get; set; }
-	}
-
-}

UserProjects/sprucely/CSharp/Composer/Composer/Graph/ComponentDefinition.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 ComponentDefinition : IMyGraph<VertexBase, EdgeBase>
-	{
-		private BidirectionalGraph<VertexBase, EdgeBase> _innerGraph;
-
-		public ComponentDefinition()
-		{
-			_innerGraph = new BidirectionalGraph<VertexBase, EdgeBase>();
-			this.ChildVertices = new List<VertexBase>();
-		}
-
-		public virtual EdgeBase Connect(VertexBase from, VertexBase to)
-		{
-			var connection = new EdgeBase(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<VertexBase> ChildVertices { get; private set; }
-
-		
-
-		#region Inner Methods
-
-		bool IGraph<VertexBase, EdgeBase>.AllowParallelEdges
-		{
-			get { return _innerGraph.AllowParallelEdges; }
-		}
-
-		bool IGraph<VertexBase, EdgeBase>.IsDirected
-		{
-			get { return _innerGraph.IsDirected; }
-		}
-
-		bool IEdgeSet<VertexBase, EdgeBase>.ContainsEdge(EdgeBase edge)
-		{
-			return _innerGraph.ContainsEdge(edge);
-		}
-
-		int IEdgeSet<VertexBase, EdgeBase>.EdgeCount
-		{
-			get { return _innerGraph.EdgeCount; }
-		}
-
-		IEnumerable<EdgeBase> IEdgeSet<VertexBase, EdgeBase>.Edges
-		{
-			get { return _innerGraph.Edges; }
-		}
-
-		bool IEdgeSet<VertexBase, EdgeBase>.IsEdgesEmpty
-		{
-			get { return _innerGraph.IsEdgesEmpty; }
-		}
-
-		bool IVertexSet<VertexBase>.IsVerticesEmpty
-		{
-			get { return _innerGraph.IsVerticesEmpty; }
-		}
-
-		int IVertexSet<VertexBase>.VertexCount
-		{
-			get { return _innerGraph.VertexCount; }
-		}
-
-		IEnumerable<VertexBase> IVertexSet<VertexBase>.Vertices
-		{
-			get { return _innerGraph.Vertices; }
-		}
-
-		bool IImplicitVertexSet<VertexBase>.ContainsVertex(VertexBase vertex)
-		{
-			return _innerGraph.ContainsVertex(vertex);
-		}
-
-		bool IIncidenceGraph<VertexBase, EdgeBase>.ContainsEdge(VertexBase source, VertexBase target)
-		{
-			return _innerGraph.ContainsEdge(source, target);
-		}
-
-		bool IIncidenceGraph<VertexBase, EdgeBase>.TryGetEdge(VertexBase source, VertexBase target, out EdgeBase edge)
-		{
-			return _innerGraph.TryGetEdge(source, target, out edge);
-		}
-
-		bool IIncidenceGraph<VertexBase, EdgeBase>.TryGetEdges(VertexBase source, VertexBase target, out IEnumerable<EdgeBase> edges)
-		{
-			return _innerGraph.TryGetEdges(source, target, out edges);
-		}
-
-		bool IImplicitGraph<VertexBase, EdgeBase>.IsOutEdgesEmpty(VertexBase v)
-		{
-			return _innerGraph.IsOutEdgesEmpty(v);
-		}
-
-		int IImplicitGraph<VertexBase, EdgeBase>.OutDegree(VertexBase v)
-		{
-			return _innerGraph.OutDegree(v);
-		}
-
-		EdgeBase IImplicitGraph<VertexBase, EdgeBase>.OutEdge(VertexBase v, int index)
-		{
-			return _innerGraph.OutEdge(v, index);
-		}
-
-		IEnumerable<EdgeBase> IImplicitGraph<VertexBase, EdgeBase>.OutEdges(VertexBase v)
-		{
-			return _innerGraph.OutEdges(v);
-		}
-
-		bool IImplicitGraph<VertexBase, EdgeBase>.TryGetOutEdges(VertexBase v, out IEnumerable<EdgeBase> edges)
-		{
-			return _innerGraph.TryGetOutEdges(v, out edges);
-		}
-
-		void IMutableBidirectionalGraph<VertexBase, EdgeBase>.ClearEdges(VertexBase v)
-		{
-			_innerGraph.ClearEdges(v);
-		}
-
-		void IMutableBidirectionalGraph<VertexBase, EdgeBase>.ClearInEdges(VertexBase v)
-		{
-			_innerGraph.ClearInEdges(v);
-		}
-
-		int IMutableBidirectionalGraph<VertexBase, EdgeBase>.RemoveInEdgeIf(VertexBase v, EdgePredicate<VertexBase, EdgeBase> edgePredicate)
-		{
-			return _innerGraph.RemoveInEdgeIf(v, edgePredicate);
-		}
-
-		void IMutableIncidenceGraph<VertexBase, EdgeBase>.ClearOutEdges(VertexBase v)
-		{
-			_innerGraph.ClearOutEdges(v);
-		}
-
-		int IMutableIncidenceGraph<VertexBase, EdgeBase>.RemoveOutEdgeIf(VertexBase v, EdgePredicate<VertexBase, EdgeBase> predicate)
-		{
-			return _innerGraph.RemoveOutEdgeIf(v, predicate);
-		}
-
-		void IMutableIncidenceGraph<VertexBase, EdgeBase>.TrimEdgeExcess()
-		{
-			_innerGraph.TrimEdgeExcess();
-		}
-
-		void IMutableGraph<VertexBase, EdgeBase>.Clear()
-		{
-			_innerGraph.Clear();
-		}
-
-		public virtual bool AddVertex(VertexBase v)
-		{
-			v.ParentComponentDefinition = this;
-			return _innerGraph.AddVertex(v);
-		}
-
-		public virtual int AddVertexRange(IEnumerable<VertexBase> vertices)
-		{
-			vertices.Apply(v => v.ParentComponentDefinition = this);
-			return _innerGraph.AddVertexRange(vertices);
-		}
-
-		bool IMutableVertexSet<VertexBase>.RemoveVertex(VertexBase v)
-		{
-			return _innerGraph.RemoveVertex(v);
-		}
-
-		int IMutableVertexSet<VertexBase>.RemoveVertexIf(VertexPredicate<VertexBase> pred)
-		{
-			return _innerGraph.RemoveVertexIf(pred);
-		}
-
-		event VertexAction<VertexBase> IMutableVertexSet<VertexBase>.VertexAdded
-		{
-			add { _innerGraph.VertexAdded += value; }
-			remove { _innerGraph.VertexAdded -= value; }
-		}
-
-		event VertexAction<VertexBase> IMutableVertexSet<VertexBase>.VertexRemoved
-		{
-			add { _innerGraph.VertexRemoved += value; }
-			remove { _innerGraph.VertexRemoved -= value; }
-		}
-
-		bool IMutableVertexAndEdgeSet<VertexBase, EdgeBase>.AddVerticesAndEdge(EdgeBase edge)
-		{
-			return _innerGraph.AddVerticesAndEdge(edge);
-		}
-
-		int IMutableVertexAndEdgeSet<VertexBase, EdgeBase>.AddVerticesAndEdgeRange(IEnumerable<EdgeBase> edges)
-		{
-			return _innerGraph.AddVerticesAndEdgeRange(edges);
-		}
-
-		bool IMutableEdgeListGraph<VertexBase, EdgeBase>.AddEdge(EdgeBase edge)
-		{
-			return _innerGraph.AddEdge(edge);
-		}
-
-		int IMutableEdgeListGraph<VertexBase, EdgeBase>.AddEdgeRange(IEnumerable<EdgeBase> edges)
-		{
-			return _innerGraph.AddEdgeRange(edges);
-		}
-
-		event EdgeAction<VertexBase, EdgeBase> IMutableEdgeListGraph<VertexBase, EdgeBase>.EdgeAdded
-		{
-			add { _innerGraph.EdgeAdded += value; }
-			remove { _innerGraph.EdgeAdded -= value; }
-		}
-
-		event EdgeAction<VertexBase, EdgeBase> IMutableEdgeListGraph<VertexBase, EdgeBase>.EdgeRemoved
-		{
-			add { _innerGraph.EdgeRemoved += value; }
-			remove { _innerGraph.EdgeRemoved -= value; }
-		}
-
-		bool IMutableEdgeListGraph<VertexBase, EdgeBase>.RemoveEdge(EdgeBase edge)
-		{
-			return _innerGraph.RemoveEdge(edge);
-		}
-
-		int IMutableEdgeListGraph<VertexBase, EdgeBase>.RemoveEdgeIf(EdgePredicate<VertexBase, EdgeBase> predicate)
-		{
-			return _innerGraph.RemoveEdgeIf(predicate);
-		}
-
-		int IBidirectionalGraph<VertexBase, EdgeBase>.Degree(VertexBase v)
-		{
-			return _innerGraph.Degree(v);
-		}
-
-		int IBidirectionalGraph<VertexBase, EdgeBase>.InDegree(VertexBase v)
-		{
-			return _innerGraph.InDegree(v);
-		}
-
-		EdgeBase IBidirectionalGraph<VertexBase, EdgeBase>.InEdge(VertexBase v, int index)
-		{
-			return _innerGraph.InEdge(v, index);
-		}
-
-		IEnumerable<EdgeBase> IBidirectionalGraph<VertexBase, EdgeBase>.InEdges(VertexBase v)
-		{
-			return _innerGraph.InEdges(v);
-		}
-
-		bool IBidirectionalGraph<VertexBase, EdgeBase>.IsInEdgesEmpty(VertexBase v)
-		{
-			return _innerGraph.IsInEdgesEmpty(v);
-		}
-
-		bool IBidirectionalGraph<VertexBase, EdgeBase>.TryGetInEdges(VertexBase v, out IEnumerable<EdgeBase> 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 : VertexBase
-	{
-		public ComponentVertex()
-		{
-			base.VertexType = VertexType.Component;
-		}
-
-		public virtual ComponentDefinition ComponentDefinition { get; set; }
-	}
-}

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

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

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

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Composer.Graph
-{
-	public class ConnectorDefinition
-	{
-
-		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 : VertexBase
-	{
-		public ConnectorVertex()
-		{
-			base.VertexType = VertexType.Connector;
-		}
-
-		public virtual ConnectorDefinition 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/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/EdgeBase.cs

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

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

 		Association = 1
 	}
 
-	public class MappableEdgeType : MappableEnumBase
+	public class MappableEdgeType : BaseMappableEnum
 	{
 	}
 }

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

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

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

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

UserProjects/sprucely/CSharp/Composer/Composer/Graph/VertexBase.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 VertexBase : IVertex
-	{
-
-		public VertexBase()
-		{
-			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 ComponentDefinition 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

 		Connector=3
 	}
 
-	public class MappableVertexType : MappableEnumBase
+	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/BaseEnumMap.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 BaseEnumMap<T> : ClassMap<T>
+		where T : BaseMappableEnum
+	{
+		public BaseEnumMap()
+		{
+			Cache.ReadOnly();
+			Id(x => x.Id);
+			Map(x => x.Name);
+		}
+	}
+}

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/Mappings.cs

-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using FluentNHibernate.Mapping;
-
-using Composer.Graph;
-
-namespace Composer.ORM
-{
-	public abstract class EnumMapBase<T> : ClassMap<T>
-		where T : MappableEnumBase
-	{
-		public EnumMapBase()
-		{
-			Cache.ReadOnly();
-			Id(x => x.Id);
-			Map(x => x.Name);
-		}
-	}
-
-
-	public class AssociationEdgeMap : SubclassMap<AssociationEdge>
-	{
-		public AssociationEdgeMap()
-		{
-			Table("Edge_Association");
-			KeyColumn("Id_Edge");
-			DiscriminatorValue(1);
-		}
-	}
-
-	public class CellCategoryMap : EnumMapBase<MappableCellCategory>
-	{
-		public CellCategoryMap()
-		{
-			Table("CellCategory");
-		}
-	}
-
-	public class CellTypeMap : EnumMapBase<MappableCellType>
-	{
-		public CellTypeMap()
-		{
-			Table("CellType");
-		}
-	}
-
-	public abstract class CellVertexMap<T> : SubclassMap<T>
-		where T : CellVertex
-	{
-		public CellVertexMap()
-		{
-			KeyColumn("Id_Vertex");
-			DiscriminatorValue((int)VertexType.Cell);
-
-			Map(x => x.CellType)
-				.Column("Id_CellType")
-				.CustomType<int>()
-				.Not.Nullable();
-		}
-	}
-
-	public class EffectorMap : CellVertexMap<Effector>
-	{
-		public EffectorMap()
-		{
-			Table("Vertex_Effector");
-		}
-	}
-
-	public class ComponentDefinitionMap : ClassMap<ComponentDefinition>
-	{
-		public ComponentDefinitionMap()
-		{
-			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");
-		}
-	}
-
-	public class ComponentVertexMap : SubclassMap<ComponentVertex>
-	{
-		public ComponentVertexMap()
-		{
-			Table("Vertex_Component");
-			KeyColumn("Id_Vertex");
-			DiscriminatorValue((int)VertexType.Component);
-			References(x => x.ComponentDefinition)
-				.Not.Nullable()
-				.Column("Id_Definition_Component");
-		}
-	}
-
-	public class ConnectionEdgeMap : SubclassMap<ConnectionEdge>
-	{
-		public ConnectionEdgeMap()
-		{
-			Table("Edge_Connection");
-			KeyColumn("Id_Edge");
-			DiscriminatorValue(0);
-		}
-	}
-
-	public class ConnectorDefinitionMap : ClassMap<ConnectorDefinition>
-	{
-		public ConnectorDefinitionMap()
-		{
-			Cache.ReadWrite();
-			Table("Definition_Connector");
-			Id(x => x.Id);
-			Map(x => x.Name)
-				.Unique()
-				.Not.Nullable()
-				.CustomSqlType("VARCHAR(100)");
-		}
-	}
-
-	public class ConnectorVertexMap : SubclassMap<ConnectorVertex>
-	{
-		public ConnectorVertexMap()
-		{
-			Table("Vertex_Connection");
-			KeyColumn("VertexType");
-			DiscriminatorValue((int)VertexType.Connector);
-			References(x => x.ConnectorDefinition)
-				.Not.Nullable()
-				.Column("Id_Definition_Connector");
-		}
-	}
-
-	public class EdgeBaseMap : ClassMap<EdgeBase>
-	{
-		public EdgeBaseMap()
-		{
-			Cache.ReadWrite();
-			Table("Edge");
-			Id(x => x.Id);