Model Driven Software Development and Service Integration Lecture
Total Page:16
File Type:pdf, Size:1020Kb
Budapest University of Technology and Economics Department of Measurement and Information Systems Fault Tolerant Systems Research Group Model Driven Software Development and Service Integration Lecture Notes and Laboratory Instructions Oszkár Semeráth Gábor Szárnyas May 10, 2013 Contents 1 Introduction 6 2 An overview of the Eclipse development environment7 2.1 Introduction.....................................................7 2.2 Project management................................................8 2.2.1 Workspace..................................................8 2.2.2 Project....................................................8 2.2.3 Package Explorer and Project Explorer.................................8 2.2.4 Build in Eclipse...............................................9 2.2.5 Copying and linking............................................9 2.2.6 Pictograms..................................................9 2.2.7 Subversion..................................................9 2.3 User interface.................................................... 10 2.3.1 Workbench.................................................. 10 2.3.2 Editors.................................................... 10 2.3.3 Views..................................................... 10 The Problems view and the Error Log view............................... 10 2.3.4 Perspective.................................................. 11 2.3.5 SWT...................................................... 11 2.3.6 Search.................................................... 11 2.4 Configuration.................................................... 11 2.4.1 Bundle.................................................... 11 2.4.2 Build path.................................................. 12 2.4.3 Execution environment.......................................... 12 2.4.4 Run configuration............................................. 12 2.4.5 The .project file.............................................. 13 2.5 The Java source code editor............................................ 13 2.5.1 Formatting the source code........................................ 13 2.5.2 Refactoring................................................. 13 1 2.5.3 Fixing problems............................................... 14 2.5.4 Zooming................................................... 14 2.5.5 Content assist and imports........................................ 14 2.5.6 Automatic generation of getter and setter methods.......................... 14 2.6 Plug-in development................................................ 15 2.6.1 Plug-in.................................................... 15 2.6.2 Runtime Eclipse............................................... 15 2.6.3 RCP...................................................... 15 2.6.4 Update site.................................................. 16 2.6.5 Install as a plug-in............................................. 16 2.6.6 The Manifest.MF file........................................... 16 2.6.7 The plugin.xml file............................................ 17 2.7 Hotkeys........................................................ 17 2.8 Sources........................................................ 18 3 Eclipse laboratory: step-by-step instructions 19 3.1 Introduction..................................................... 19 3.2 Java project...................................................... 19 3.3 Plug-in project.................................................... 21 3.4 Version control................................................... 22 3.4.1 Sharing projects............................................... 22 4 BPMN 25 4.1 Introduction..................................................... 25 4.2 Sources........................................................ 25 5 BPMN laboratory – step-by-step instructions 26 5.1 Simple workflow.................................................. 26 5.2 Complex workflow................................................. 31 5.3 Tips.......................................................... 33 6 Web services 35 6.1 Introduction..................................................... 35 6.2 Remarks....................................................... 35 6.3 Apache Tomcat................................................... 35 6.4 WSDL......................................................... 36 6.5 JAX-RS........................................................ 36 6.5.1 Jersey..................................................... 36 6.6 JAXB.......................................................... 36 6.7 Maven........................................................ 36 2 7 Web services laboratory – step-by-step instructions 37 7.1 Prerequisites..................................................... 37 7.1.1 Eclipse WTP................................................. 37 7.1.2 Maven.................................................... 39 7.2 Datatypes...................................................... 39 7.3 JAX-WS........................................................ 40 7.4 JAX-RS........................................................ 45 7.4.1 Creating the project............................................ 45 7.4.2 Dependencies................................................ 45 7.4.3 Java code................................................... 45 7.4.4 Deployment................................................. 46 7.5 JAXB.......................................................... 48 7.6 Tomcat Web Application Manager........................................ 49 7.6.1 Performance monitoring......................................... 50 7.7 Testing a REST application............................................ 50 7.8 Google App Engine................................................. 52 7.9 Tips and troubleshooting............................................. 52 7.10 Additional materials................................................ 52 7.10.1 Creating a JSP Servlet............................................ 52 7.11 Sources........................................................ 55 8 Yakindu 56 8.1 Prerequisites..................................................... 56 8.2 Modeling....................................................... 57 8.3 Code generation................................................... 60 8.4 Tips.......................................................... 64 9 Bonita 65 9.1 Introduction..................................................... 65 9.2 Scripting Reminder................................................. 65 9.3 Database Integration................................................ 65 9.4 Web services..................................................... 67 9.4.1 SOA web service............................................... 67 SoapUI.................................................... 68 9.4.2 REST web service.............................................. 68 9.5 Creating a new connector............................................. 68 3 10 Introduction to the Eclipse Modeling Framework 76 10.1 About the EMF................................................... 76 10.2 Description of the task............................................... 76 10.3 Prerequisites..................................................... 76 10.4 Ecore model: step-by-step............................................. 76 10.5 Editor: step-by-step................................................. 79 10.6 Model manipulation: step-by-step........................................ 80 10.7 Summary....................................................... 82 10.8 General tips..................................................... 82 11 Code generation technologies 84 11.1 JVM based languages................................................ 84 11.1.1 Scala..................................................... 84 11.1.2 Groovy.................................................... 84 11.1.3 Clojure.................................................... 85 11.2 Code generation with Eclipse technologies................................... 85 11.2.1 Xtext..................................................... 85 11.2.2 Xbase..................................................... 85 11.2.3 Xpand.................................................... 86 Xtend (deprecated)............................................. 86 11.2.4 Xtend (previously called Xtend2)..................................... 86 12 JPA 88 13 Code generation laboratory 93 14 NoSQL 96 14.1 Neo4j console.................................................... 96 14.2 Embedded mode.................................................. 97 14.2.1 Dependencies................................................ 97 14.2.2 Java code................................................... 97 14.2.3 Neoclipse.................................................. 100 14.2.4 Cypher query from Java.......................................... 100 14.3 Server mode..................................................... 101 14.3.1 Using the REST API manually....................................... 101 14.3.2 Web administration interface....................................... 101 14.3.3 REST API in Java.............................................. 103 Installing Maven.............................................. 103 Compiling the Neo4j java-rest-binding project with Maven................... 103 Creating the Java application....................................... 104 4 15 IncQuery 106 15.1 Setup......................................................... 106 15.2 Simple Query Language Tutorial......................................... 107 15.3 Visualization