Beispiel #1
0
        public void Add(string memberClassNamespace, string memberClassName, string memberLabel)
        {
            GraphNode member = new GraphNode(memberLabel);

            member.Container  = memberClassName;
            member.Container2 = memberClassNamespace;
            GraphEdge membership = new GraphEdge(member, HeadOfList);

            LocalMember.Add(membership);
        }
Beispiel #2
0
        public ForeignKey(string tableName, string columnLabel, string toTableName, string toPrimaryKey)
        {
            ForeignTableColumn           = new GraphNode(columnLabel);
            ForeignTableColumn.Container = tableName;

            PrimaryTableColumn           = new GraphNode(toPrimaryKey);
            PrimaryTableColumn.Container = toTableName;

            FromForeignToPrimary = new GraphEdge(ForeignTableColumn, PrimaryTableColumn, "Foreign Key");
        }
Beispiel #3
0
 public void Add(GraphEdge edge1)
 {
     _edge.Add(edge1);
 }
Beispiel #4
0
        public void L4_test()
        {
            Assert.ThingsAbout("hi", "world");


            // --------------------------------------------------------------------------
            // L4: (constructs at this level should be able to subsume the other levels)
            // --------------------------------------------------------------------------
            GraphMain graph = new GraphMain();
            GraphNode node1 = new GraphNode("Jon");
            GraphNode node2 = new GraphNode("Grover");
            GraphEdge edge  = new GraphEdge(node1, node2);

            graph.Add(node1);
            graph.Add(node2);
            graph.Add(edge);
            string strEdge = edge.ToString();

            Assert.That(strEdge, Is.equal_to, "Jon -> Grover");


            // --------------------------------------------------------------------------
            // L3 concrete class: (there is no language, system or tool yet)
            // --------------------------------------------------------------------------
            MemberListConcrete dog = new MemberListConcrete("AnimalNamespace", "Dog");

            dog.Add("AnimalNamespace", "AppendageList", "Paws");
            dog.Add("AnimalNamespace", "Sense", "Nose");
            string strMemberList = dog.ToString();

            Assert.That(strMemberList, Is.equal_to, "Dog : Paws, Nose");

            // --------------------------------------------------------------------------
            // L3 abstract class: (there is no language, system or tool yet)
            // --------------------------------------------------------------------------
            MemberList dog2 = new MemberList("AnimalNamespace", "Dog");

            dog2.Add("AnimalNamespace", "AppendageList", "Paws");
            dog2.Add("AnimalNamespace", "Sense", "Nose");
            strMemberList = dog2.ToString();
            Assert.That(strMemberList, Is.equal_to, "Dog : AnimalNamespace.AppendageList.Paws -> AnimalNamespace.Dog., AnimalNamespace.Sense.Nose -> AnimalNamespace.Dog.");



            // --------------------------------------------------------------------------
            // L2 concrete class: (oo languages)
            // --------------------------------------------------------------------------
            InheritClassConcrete inheritRelation = new InheritClassConcrete("Dog", "Animal");

            Assert.That(inheritRelation.ToString(), Is.equal_to, "Dog : Animal");
            inheritRelation = new InheritClassConcrete("AnimalNamespace", "Dog", "AnimalNamespace", "Animal");
            Assert.That(inheritRelation.ToString(), Is.equal_to, "AnimalNamespace.Dog : AnimalNamespace.Animal");

            // --------------------------------------------------------------------------
            // L2 abstract class: (oo languages) - basing L2 on L4
            // --------------------------------------------------------------------------
            InheritClass inheritRelation2 = new InheritClass("Dog", "Animal");

            Assert.That(inheritRelation2.ToString(), Is.equal_to, "Dog : Animal");
            inheritRelation2 = new InheritClass("AnimalNamespace", "Dog", "AnimalNamespace", "Animal");
            Assert.That(inheritRelation2.ToString(), Is.equal_to, "AnimalNamespace.Dog : AnimalNamespace.Animal");



            // --------------------------------------------------------------------------
            // L1 concrete class: (databases)
            // --------------------------------------------------------------------------
            ForeignKeyConcrete join    = new ForeignKeyConcrete("EggDetail", "ParentEggID", "EggMaster", "EggID");
            string             strJoin = join.ToString();

            Assert.That(strJoin, Is.equal_to, "EggDetail.ParentEggID >- EggMaster.EggID");

            // --------------------------------------------------------------------------
            // L1 abstract class: (databases) basing L1 on L4
            // --------------------------------------------------------------------------
            ForeignKey join2    = new ForeignKey("EggDetail", "ParentEggID", "EggMaster", "EggID");
            string     strJoin2 = join2.ToString();

            Assert.That(strJoin2, Is.equal_to, "EggDetail.ParentEggID >- EggMaster.EggID");


            _result += Assert.Conclusion;
        }
Beispiel #5
0
 public InheritClass(string myNamespace, string className, string parentNamespace, string parentName)
 {
     MyClass     = new GraphNode(className); MyClass.Container = myNamespace;
     ParentClass = new GraphNode(parentName); ParentClass.Container = parentNamespace;
     Inheritance = new GraphEdge(ParentClass, MyClass, "Inherits");
 }
Beispiel #6
0
 public InheritClass(string name, string parent)
 {
     MyClass     = new GraphNode(name);
     ParentClass = new GraphNode(parent);
     Inheritance = new GraphEdge(ParentClass, MyClass, "Inherits");
 }