Exemple #1
0
        static void Main()
        {
            /*This class would connect program with MySQL to:
             * 1:get target database schema's information
             * 2:save information into table classes and method classes we defined;*/
            var theDB = new dataSchemer(myConnectionString);
            Console.WriteLine("Connecting database success!");
            Console.WriteLine();

            /*This class would go through all the methods in your target project to:
             * 1:find out all the sql statements;
             * 2:build call graph;
             * 3:generate method descriptions for methods with local sql invocations.*/
            var extractor = new ExtractMethodSQL(testLoc, SrcmlLoc, theDB);
            extractor.run();
            Console.WriteLine("Building callGraph and extracting SQL sequences success!");
            Console.WriteLine();

            /*This class would:
             * 1:save methods information into tables class and column class;
             * 2:generate methods description for methods without local sql but still in call graph.*/
            var mapper = new dbMethodMapper(extractor, theDB);
            mapper.run();
            Console.WriteLine("Mapping database with methods success!");
            Console.WriteLine();

            //This class would generate reports according to all table classes and column classes.
            var reporter = new infoCollector(extractor, theDB,reportLoc);
            reporter.run();
            Console.WriteLine("Report has been generated! Press any key to exit..");
            Console.ReadKey(true);

            //PS: the details about each class would be described in the manual I submit.
        }
 public infoCollector(ExtractMethodSQL ex, dataSchemer dbsche, string reportLoc)
 {
     this.AllTableSummary = new HashSet<SingleSummary>();
     this.AllColumnSummary = new HashSet<SingleSummary>();
     this.extractor = ex;
     this.db = dbsche;
     this.outputLoc = reportLoc;
 }
 public dbMethodMapper(ExtractMethodSQL ex, dataSchemer dbsche)
 {
     this.extractor = ex;
     this.db = dbsche;
     this.tablesInfo = db.tablesInfo;
 }