package judyexample; import CR.AbstractClass; import CR.Normalize; public class Konstants { final static String cdspec1 = "test/TestData/PD1.cdspec.pl"; final static String schema1 = "PD1.schema.pl"; final static String cdspec2 = "PD2.cdspec.pl"; final static String schema2 = "PD2.schema.pl"; final static String cdspec3 = "PD3.cdspec.pl"; final static String schema3 = "PD3.schema.pl"; static AbstractClass.Args args1 = new AbstractClass.Args("Entity","Person","Dog"); // pull up shared fields into abstract class Entity from subclasses Person and Dog static Normalize.Args args2 = new Normalize.Args("ae", "Address", "addr", "Entity", "livesAt", "zipcode","state"); // Normalize "Entity" by creating and Address class with (zipcode and state) fields. The association that // connects Entity to Address is named "ae", the role with Address is addr, the role of Entity is livesAt } |
package judyexample; import CR.AbstractClass; import CR.Normalize; public class RiderLevel extends Konstants { public static void main(String... args) throws Exception { // Step 0: input data is hard-coded for this example // Step 1: create schema for PD1 (schema1) M4.CDSpec2Schema.main(cdspec1); // Step 2: refactor PD1 to PD2, and create schema for PD2 AbstractClass.PullUp(cdspec1, cdspec2, args1); M4.CDSpec2Schema.main(cdspec2); // Step 3: refactor PD2 to PD3, and create schema for PD3 Normalize.Normalize(cdspec2, cdspec3, args2); M4.CDSpec2Schema.main(cdspec3); } } |
package judyexample; import CR.AbstractClass; import CR.Normalize; public class CamelLevel extends Konstants{ public static void main(String... args) { // Step 0: input data is hard-coded for this example // Step 1: refactor data.PD1.pl to data.PD2.pl // <input.oldschema.pl> <outSchema.schema.pl> <out.outschema.pl> args AbstractClass.PullUpDB("data.PD1.pl","PD2.schema.pl","data.PD2.pl",args1); // Step 2: refactor data.PD2.pl to data.PD3.pl Normalize.NormalizeDB("data.PD2.pl","PD3.schema.pl","data.PD3.pl",args2); } } |