0 Introduction
As the creator of the Java language, Sun company released the enterprise-class Java platform J2ee--java 2 enterise Edition at the end of 1999. With the launch of the Java EE 1.5 standard, Sun will officially renamed Java EE. Java EE is not a product, but a collection of technologies and standards. The products under the specific Java EE platform are implemented by each vendor and follow the same standard. This article describes a Java EE application Rapid development tool, based on GEF and EMF technology, which can automatically generate struts+spring+hibernate based Java EE applications quickly and efficiently--jstudio. The tool can greatly reduce the workload of program developers writing repetitive code, while improving the quality of the code, which can shorten the development cycle and reduce development costs.
1 Overview of GEF and EMF Technologies
GEF (graphical editing framework) and EMF (Eclipse Modeling Framework) are 2 subprojects under Eclipse, primarily for the development of desktop programs. GEF is the graphical editing framework provided by Eclipse, and GEF can provide users with a graphical editing model to enhance the user experience. EMF is the model-driven application development framework provided by eclipse that produces the framework for code. EMF can create Java code that enables graphical data editing, manipulation, reading, and serialization based on the model specified in XML SCHEMA,UML or annotated java.
The model used to describe the EMF model, called Ecore, is essentially a subset of UML class diagrams, a simple model of the classes and data that are applied. When the Ecore is established, EMF adopts the design of separating the interfaces, and automatically generates 1 interfaces and one implementation class for each class (Eclass) in Ecore.
The interfaces in this will inherit the set interfaces in these EMF Eobject, as Java.lang.Object in Java. EMF also generates an interface and implementation class for each model corresponding to factory and package respectively. Where **factory inherits from Efactory and provides create*** methods for the creation of each class in the model. In Jstudio, using EMF to implement business model object establishment and code generation, reduce the workload of developers, improve efficiency, and generate the code concise and efficient.
Analysis and design of 2 rapid development tools
Composition and function of 2.1 jstudio
Jstudio mainly includes GUI (graphical interface) and scaffold (code frame) 2 parts. GUI refers to the visual and graphical operation interface of tools, it is mainly implemented by GEF technology, and expands the workbench, perspective, Main Menu and wizard extension points in the Eclipse platform, and eventually runs on the operating system independently in the Eelipse rcp form, becoming a standard desktop application program. Jstudio interface is simple, beautiful, and has a good user experience. Scaffold is the tool that generates a struts+spring+hibernate based code framework. The generated code contains the standard code for the four layers of the page display layer, the control layer, the business logic layer, and the data persistence layer in the Java EE application to realize the function of checking and deleting each model. Jstudio features include environment configuration, model building, code generation, page editing, database editing and release deployment, covering various operations and steps of Java EE application Development, developers can realize the whole process of code from scratch, program from design to running in Jstudio.
2.2 Jstudio Whole process
The Jstudio steps include creating a new model file, building a model, generating code, generating a database, and publishing a deployment, as shown in Figure 1. With the steps shown in Figure 1, developers can quickly develop a set of Java EE applications that contain each model object and the ability to change and search without writing a single line of code.