Chapter 7 Working with Eclipse
Generating an Eclipse Project
Eclipse is a platform that allows third parties to add plugins to provide new features and extend the platform. For example, a plugin could provide IDE features, modeling features, code generator, and so on.
There are two Eclipse plugins that may be used by PowerDesigner customers:
- JDT (Java Development Tool) is an IDE that allows users to develop Java applications, edit Java code, browse Java classes and compile Java code. Users can define other build commands
- EMF (Eclipse Modeling Framework) is a modeling framework and code generation facility for building tools and other applications based on a structured object model. From the definition of a model called Ecore model, it can generate all the necessary Java code for metadata management, navigation between classes, serialization/deserialization in XML format, Eclipse browser plugin for creating and modifying instance data
Java development
PowerDesigner and Eclipse enable round-trip engineering for Java development:
- Perform high level analysis and design using PowerDesigner
- Design and create Java components in PowerDesigner
- Generate Java code and Eclipse project files
- Open the project in Eclipse
- Finish the implementation of Java classes using Eclipse
- Compile, package, deploy and debug using Eclipse
- Reverse engineer the final Java code to synchronize the PowerDesigner model
Eclipse project generation
An Eclipse project is stored in a directory. The name of the project is the name of the directory. A project is defined by:
- A .project file that defines the name of the project and the build commands
- A .classpath file that defines the source directory, the binary directory and the list of libraries
- Source files and other files
By default, a Java project only supports the build command for compilation. Additional commands must be defined with command lines or Ant tasks, which is not always easy to do. Users may also need to add additional libraries to compile Java files.
PowerDesigner can generate the following files:
- .project
- .classpath
- build.xml for Ant build script
Depending on the type of Java classes contained in a model, PowerDesigner can also add the necessary build tasks and libraries to prevent the users from doing it manually.
With the generated Eclipse Project files, users can immediately:
- Compile Java classes
- Package Java classes to create .JAR, .WAR or .EAR files
- Generate Javadoc
- Run J2EE verifier
- Deploy the .JAR, .WAR or .EAR file into Sybase EAServer, BEA WebLogic, IBM WebSphere and Apache Tomcat
To generate an Eclipse project, you have to create an OOM with the correct profile and define generation options.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|