there is a corresponding generated § Java interface § Java implementation class § For each package, there is a § XXXPackage interface and implementation class § XXXFactory interface and implementation class
instances use § XXXPackage.eINSTANCE § XXXFactory.eINSTANCE § Use the Factory to create instances of your model classes, e.g: TaskList t = ExampleFactory.eINSTANCE.createTaskList(); § Use the Package to access the meta-model definition, e.g: EClass c = ExamplePackage.eINSTANCE.getTaskList(); List attrs = c.getEAttributes();
§ plain old Java object (POJO) § We have generated over 1,000 LOC, § Even very simple code is considered to be worth $1 per LOC. So, $1,000 just by clicking some buttons
all the entities of your model. § Add methods starting with “test” to create single test cases. § Run test cases with a right-click on the test class then. “Debug As” => “JUnit Test”. In this context, test cases are very simple way of exploring and using the API of the generated classes.
create a Course and a Student public class CourseTest extends TestCase { // original code... public void testCourseStudentReference() { Course course = MyModelFactory.eINSTANCE.createCourse(); Student s1 = MyModelFactory.eINSTANCE.createStudent(); course.getStudents().add(s1); assertEquals(course.getStudents().get(0), s1); } }
Model in EMF (take a screen shoot) 2. Use the Code to Create a Class Diagram (only the Model and Test packages and include both interfaces and implementations). It will be bigger and more complex that the one provided 3. Create a document with the screen shoot of your model and your UML diagram. The diagram is going to be bigger and different from the one used as input! Car Engine Wheel
between modules should terminate on a module whose Instability is less than or equal to the depending module's Instability. § Every dependency between modules should terminate on a module whose Abstractness is greater than or equal to the depending module's Abstractness.