WebSphere Studio Application Developer Version 5 Programming Guide part 5 ppsx

10 265 0
WebSphere Studio Application Developer Version 5 Programming Guide part 5 ppsx

Đang tải... (xem toàn văn)

Thông tin tài liệu

14 WebSphere Studio Application Developer Version 5 Programming Guide Relational database tools The database tools provided with the WebSphere family products allow you to create and manipulate the data design for your project in terms of relational database schemas. You can explore, import, design, and query databases working with a local copy of an already existing design. You can also create an entirely new data design from scratch to meet your requirements. The database tools provide a metadata model used by all other tools that need relational database information, including database connection information. In that way, tools, although unaware of each other, are able to share connections. The SQL Statement Wizard and SQL Query Builder provide a GUI-based interface for creating and executing SQL statements. When you are satisfied with your statement, you can use the SQL to XML Wizard to create an XML document, as well as XSL, DTD, XSD, HTML, and other related artifacts. The relational database tools support connecting to, and importing from, several database types, including DB2, Oracle, SQL Server, Sybase, and Informix®. XML tools The comprehensive XML toolset provided by the WebSphere Studio family of products includes components for building DTDs, XML schemas (XSD) and XML files. With the XML tools you can perform all of the following tasks:  Create, view, and validate DTDs, XML schemas, and XML files.  Create XML documents from a DTD, from an XML schema, or from scratch.  Generate JavaBeans from a DTD or XML schema.  Define mappings between XML documents and generate XSLT scripts that transform documents.  Create an HTML or XML document by applying an XSL style sheet to an XML document.  Map XML files to create an XSL transformation script and to visually step through the XSL file.  Define mappings between relational tables and DTD files, or between SQL statements and DTD files, to generate a document access definition (DAD) script, used by IBM DB2 XML Extender. This can be used either to compose XML documents from existing DB2 data or to decompose XML documents into DB2 data.  Generate DADX, XML, and related artifacts from SQL statements and use these files to implement your query in other applications. Chapter 1. Introduction and concepts 15 Java development tools (JDT) All WebSphere Studio family of products provide a professional-grade Java development environment with the following capabilities:  Application Developer Version 5 ships with JDK 1.3  Pluggable run-time support for JRE switching and targeting of multiple run-time environments from IBM and other vendors  Incremental compilation  Ability to run code with errors in methods  Crash protection and auto-recovery  Error reporting and correction  Java text editor with full syntax highlighting and complete content assist  Refactoring tools for reorganizing Java applications  Intelligent search, compare, and merge tools for Java source files  Scrapbook for evaluating code snippets Web services development tools Web services represent the next level of function and efficiency in e-business. Web services are modular, standards-based e-business applications that businesses can dynamically mix and match in order to perform complex transactions with minimal programming. The WebSphere Studio family of products that include the Web services feature, help you to build and deploy Web services-enabled applications across the broadest range of software and hardware platforms used by today's businesses. These tools are based on open, cross-platform standards such as Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL), and Universal Description Discovery and Integration (UDDI). EJB development tools The WebSphere Studio family of products, except Site Developer Advanced, feature full EJB support (Application Developer V5 supports EJB 1.1 and 2.0), an updated EJB test client, an enhanced unit test environment for J2EE, and deployment support for Web application archive (WAR) files and enterprise application archive (EAR) files. Entity beans can be mapped to databases, and EJB components can be generated to tie into transaction processing systems. XML provides an extended format for deployment descriptors within EJB. 16 WebSphere Studio Application Developer Version 5 Programming Guide Team collaboration Team developers do all of their work in their individual Workbenches, and then periodically release changes to the team code. This model allows individual developers to work on a team project, share their work with others as changes are made, and access the work of other developers as the project evolves. At any time, developers can update their Workbenches by retrieving the changes that have been made to the team code. All products of the WebSphere Studio family support the Concurrent Versions System (CVS) and the Rational ClearCase® LT products. Other software configuration management (SCM) repositories can be integrated through the Eclipse Workbench SCM adapters. SCM adapters for commercial products are provided by the vendors of those products. Debugging tools The WebSphere Studio family of products include a debugger that enables you to detect and diagnose errors in your programs running either locally or remotely. The debugger allows you to control the execution of your program by setting breakpoints, suspending launches, stepping through your code, and examining the contents of variables. You can debug live server-side code as well as programs running locally on your workstation. The debugger includes a debug view that shows threads and stack frames, a process view that shows all currently running and recently terminated processes, and a console view that allows developers to interact with running processes. There are also views that display breakpoints and allow you to inspect variables. Performance profiling tools The WebSphere Studio family of products (except for Site Developer) provide tools that enable you to test the performance of your application. This allows you to make architectural and implementation changes early in your development cycle, and significantly reduces the risk of finding serious problems in the final performance tests. The profiling tools collect data related to a Java program's run-time behavior, and present this data in graphical and non-graphical views. This assists you in visualizing program execution and exploring different patterns within the program. Chapter 1. Introduction and concepts 17 These tools are useful for performance analysis and for gaining a deeper understanding of your Java programs. You can view object creation and garbage collection, execution sequences, thread interaction, and object references. The tools also show you which operations take the most time, and help you find and plug memory leaks. You can easily identify repetitive execution behavior and eliminate redundancy, while focusing on the highlights of the execution. Server tools for testing and deployment The server tools provide a unit test environment where you can test JSPs, servlets and HTML files, (EJB testing is supported in Application Developer and Enterprise Developer). You also have the capability to configure other local or remote servers for integrated testing and debugging of J2EE applications. The following features are included:  A copy of the complete WebSphere Application Server run-time environment.  Standalone unit testing.  Ability to debug live server-side code using the integrated debugger.  Support for configuring multiple servers. The server tools support the following run-time environments, which can be installed locally or remotely and support testing of Web applications:  WebSphere Application Server Version 5.0  WebSphere Application Server Express Version 5.0  WebSphere Application Server Version 4.0 (AEs)  Apache Tomcat Version 4.1  Apache Tomcat Version 4.0  Apache Tomcat Version 3.2 Plug-in development tools The WebSphere Studio product family (except for Site Developer) include the plug-in development environment (PDE) that is designed to help you develop platform plug-ins while working inside the platform Workbench and it provides a set of platform extension contributions (views, editors, perspectives, etc.) that collectively streamline the process of developing plug-ins inside the Workbench. The PDE is not a separate tool, but it is a perspective. The following project types are supported:  Plug-in project—Application Developer is based on the concept of plug-ins that have a clearly defined structure and specification. This project supports the ability to create, test, and deploy a plug-in in the PDE. 18 WebSphere Studio Application Developer Version 5 Programming Guide  Fragment project—A plug-in fragment is used to provide additional plug-in functionality to an existing plug-in after it has been installed. Fragments are ideal for shipping features like language or maintenance packs that typically trail the initial products by a few months.  Plug-in component—PDE attaches a special component nature to plug-in and fragment projects to differentiate them from other project types. The project must have a specific folder structure and a component manifest. The project must be set up with references to all of the plug-in and fragment projects that will be packaged into the component. Sample code in this book All the code examples in this book are based on a banking model (Figure 1-3). This model was used in the IBM Redbook EJB 2.0 Development with WebSphere Studio Application Developer , SG24-6819. Figure 1-3 Banking model The banking model is supported by a relational database called EJBBANK. In this book we only use a subset of the model: Customer, Account, and TransRecord. For simple Java and Web development we implement the model in memory. For advanced development, such as Web with database and EJB, we use the relational database. Customer Account m:m 1:m TransRecord Checking Savings update create business logic Deposit, Withdraw, Transfer Bank 1:m Chapter 1. Introduction and concepts 19 EJBBANK database The database consist of the tables shown in Table 1-1. Only the shaded tables are used in the examples in this document. Table 1-1 EJBBank tables See Appendix C, “Additional material” on page 809 for instructions on how to create and load the EJBBANK database. Naming convention All projects and packages used in this book follow a naming convention:  ItsoProGuideXxxxx for projects  itso.xxxx for packages Table Description CUSTOMER Bank customer with ID, title, firstname, lastname, user ID, password, and address. ACCOUNT Bank account with ID, balance, interest rate, account type, overdraft amount (CHECKING) and minimum amount (SAVINGS). TRANSRECORD Transaction record with ID, account ID, transaction type (deposit, withdraw), and amount. CUSTACCT Relationship table between CUSTOMER and ACCOUNT. CUSTADDRESS Customer address with customer ID, street, city, state, zipcode (not used in this book). CUSTOMERINFO Customer information, for example picture (not used in this book). CHECKING Checking account, subtype of account, with overdraft amount (not used in this book) SAVINGS Savings account, subtype of account, with minimum amount (not used in this book). 20 WebSphere Studio Application Developer Version 5 Programming Guide Summary This chapter introduced the concepts behind Application Developer and gave an overview of the features of the various members of the WebSphere Studio family of tools. The following topics were discussed:  Eclipse  Platform architecture  Workbench features  WebSphere Studio products  What is new in Application Developer Version 5  Too ls  Sample code in this book © Copyright IBM Corp. 2003. All rights reserved. 21 Chapter 2. Setting up your Workbench and workspace preferences After you have installed Application Developer, and before you start creating your projects, you may want to modify some of the default Workbench settings to suit your needs or site standards. This chapter describes the most important areas where you can customize the Application Developer setup. The following topics are discussed in this chapter:  Workbench basics  Java development preferences 2 Note: Installation of Application Developer is covered in Appendix A, “Product installation” on page 785. 22 WebSphere Studio Application Developer Version 5 Programming Guide Workbench basics Once you have started Application Developer, you will see it opened in a single window. Application Developer initially displays a perspective — the J2EE perspective. A perspective contains views, such as the J2EE Navigator view, and editors. More information regarding perspectives and views are provided in Chapter 3, “Perspectives, views, and editors” on page 47. Figure 2-1 shows Application Developer’s initial Workbench. Figure 2-1 Application Developer Workbench At the far left of the window is a shortcut bar that allows you to open new perspectives and navigate between perspectives that are already open. The name of the active perspective is shown in the title of the window and its icon in the shortcut bar (left side) is a pushed button. The J2EE Hierarchy, Tasks, and Outline views are open, along with an editor on the welcome page. The welcome page provides a quick starting point if you are eager to customize your Workbench or learn about other installed features. Chapter 2. Setting up your Workbench and workspace preferences 23 The term Workbench refers to the desktop development environment. Each Workbench window of Application Developer contains one or more perspectives. Perspectives contain views and editors and control what appears in certain menus and toolbars. Workspace basics The Application Developer workspace is a private work area for the individual developer. It holds the environment metadata and the loaded projects’ data in regular files. Every time you save a resource, the changes are reflected in the file system. Normally this is your local file system, but you can also choose to store your workspace in a network file system (NFS) as well. Application Developer also allows you to open more than one Workbench at a time. To open a new Workbench in another window, click Window -> New Window and a new Workbench with the same perspective opens in a new window. If you do not specify otherwise, Application Developer creates a default workspace which is placed in the directory: My Documents\IBM\wsad\workspace However, you can change the default workspace by starting Application Developer with the -data workspacePath parameter where the workspacePath points to your preferred workspace directory. Relative paths are interpreted relative to the directory that Application Developer was started from. Note: The advantages of storing workspaces in NFSs are such as ease of backup—it is easier for the administrators to back up a team’s workspaces if they all stand in the same machine—and increased mobility, as you may connect to the workspace from any machine on the network. The disadvantage, though, is decreased performance and mobility (laptop). Tip: If for some reason you ever need to clean your workspace and start over from scratch, the quickest way would be to exit Application Developer and rename the workspace directory. Upon restarting Application Developer, you would have a clean workspace. You could then import the resources that you still require from the old workspace directory. . testing of Web applications:  WebSphere Application Server Version 5. 0  WebSphere Application Server Express Version 5. 0  WebSphere Application Server Version 4.0 (AEs)  Apache Tomcat Version 4.1 . page 7 85. 22 WebSphere Studio Application Developer Version 5 Programming Guide Workbench basics Once you have started Application Developer, you will see it opened in a single window. Application. amount (not used in this book). 20 WebSphere Studio Application Developer Version 5 Programming Guide Summary This chapter introduced the concepts behind Application Developer and gave an overview

Ngày đăng: 03/07/2014, 20:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan