|
|
|
This chapter has introduced the WebSphere Studio Development Tools. The tools are available in a number of different editions, targeting developers who are creating increasingly complex applications. Each new edition is a superset of the previous editions, providing a consistent approach to WebSphere application development.
The tools are built on the Eclipse platform, and
consist of a variety of editors, resource types, and views.
Resources under development in WebSphere Studio are primarily
contained in projects that model J2EE modules; web projects, EJB
projects, and Enterprise Application Projects. Wizards and
There is also support for testing and execution of the application under development; built-in unit test servers allow for execution on WebSphere version 4.0 or version 5.0, with automatic server configuration and activation. The application itself can also be profiled, to analyse its call flow and performance characteristics.
Prior to WebSphere Studio, the development of
J2EE applications required separate tools for each stage of the
process; design, web page development, business logic development,
data design, deployment, application debugging and performance
profiling. With WebSphere Studio, you now have a single development
environment that
|
|
|
|
|
|
We are often asked about how to build applications that can be ported easily to (or from) other application servers. Doing so requires that you confine yourself to the standard programming model defined by J2EE. This part of the book will take you through the major elements of the J2EE programming model for web, enterprise, and service-oriented
One of our objectives for this book has been to be more than just a J2EE primer. We want to help you understand the relationship between your application and the underlying WebSphere runtime. We believe that doing so will lead you to build more efficient and durable components. This part of the book is no exception, as we show you how the application server functions in the presence of different design practices. In particular, we highlight how you can apply
We
Web services are quickly proving to be a critical component in distributed computing. The fundamental
All of the principles discussed in this part of the book are based on the J2EE 1.3 standard and only leverage features of the base WebSphere Application Server runtime and WebSphere Studio Application Developer tool.
When you get done with this part of the book you will have a good understanding of how to build a conforming J2EE application, including the role that web services may play in your distributed computing environment. More importantly, you will understand the inter-relationship between your application and the underlying application-server runtime and the things the runtime does to manage the information infrastructure on which your application is hosted – so that you don't have to.
This part of the book makes heavy use of the Plants-By-WebSphere sample application. The Plants-By-WebSphere application is a sample shipped in the WebSphere Application Server, along with source code, to
We have substantially modified the Plants-By-WebSphere sample in this book to demonstrate aspects of the J2EE programming model and web services concepts that were not covered in the original example provided by IBM. You will want to use the version of the sample shipped with this book if you are going to follow the
| Important |
If you are using the WebSphere Application Server, be sure to uninstall the Plants-By-WebSphere example application that ships with WebSphere. Also, you need to remove the data sources that are pre-installed with WebSphere for the Plants-By-WebSphere example. The examples in this book will walk you through creating data sources that are appropriate for the modified example presented here, and the data sources shipped with WebSphere will interfere with those created in this book. Refer to Chapter 14 for more information on un installing applications and removing data sources. |
The Plants-By-WebSphere application represents a mail-order storefront for plants, trees, and garden tools:
The Plants-By-WebSphere sample in this book is
JSP pages
cart
checkout
Presents a form for gathering credit-card and shipping information; the contents of the checkout form, along with the contents of the shopping cart.
orderdone
Presents confirmation of the completed order submission.
product
Presents the a detailed view of the item selected from the main catalog pages.
salesitems
Frames the component images of the main home-page logo for the store front.
showcatalog
Lists the contents of the catalog; the contents of the catalog are taken from the catalog database retrieved through the
Inventory
EJB.
Other Pages
index.html
This is the home page for the store; presenting the store front logo and providing navigation to the main features of the web site.
banner.html
Presents the standard noteback tab metaphor for navigating the web site.
Servlets
ShoppingControllerServlet
The main point of control for
Model Wrappers
CartModel
A wrapper to the
ShoppingCart
EJB.
CustomerModel
A wrapper to the
Customer
EJB.
InventoryModel
A wrapper to the
Inventory
EJB.
OrderModel
A wrapper to the
Order
EJB.
EJBs
Catalog
A stateless session bean that collects information from the store inventory that can be used to present a visual catalog to shoppers.
Customer
A CMP entity bean representing customers that have purchased items from the store.
FulFillOrder
A stateless session bean used to complete the order request processing.
Inventory
A CMP entity bean that represents the inventory of items that are available for sale through the plant store. In addition to identifying and depicting the items in the store's catalog, it also retains the price and quantity of stock on hand for each item.
Order
A CMP entity bean used to represent a particular customer order.
OrderIdGenerator
A CMP entity bean that is responsible for creating unique order
OrderItem
A CMP entity bean that captures the type and quantity of a specific product ordered.
OrderItems
are aggregated by an
Order
.
OrderSender
A stateless session bean used to send a message when the order is complete.
OrderReceiver
A message-driven bean that receives order messages and calls the
FulFillOrder
bean to complete the order processing.
ShoppingCart
A stateful session bean that holds the contents of the shopping cart. The shopping cart is
Helper classes
CustomerInfo
A Java holder-object for the
Customer
bean.
InsufficientInventoryException
This exception is thrown by the
FulFillOrder
bean if the order cannot be filled.
OrderInfo
A holder object for the
Order
bean.
StoreItem
A holder-object for the contents of an item in the
Catalog
. This holder-object is used to pass around the information about the
Catalog
item. It is used in many of the operations on the
Catalog
.
Util
It supports a variety of helper functions used throughout the Plants-By-WebSphere application for various repeated activities, such as getting EJB
Web Services
PlantsByWebSphereCatalogService
This is a web service representing the
PlantsByWebSphereCatalog
port-type with a SOAP binding. This service can be used to get product information from the
Catalog
.
The following diagram depicts the general structure of the Plants-By-WebSphere example produced in this part of the book:
The JSP pages and servlets are developed in Chapter 4. The web application portion of this example is developed to use a set of wrappers to the EJBs in the EJB module. This technique allows the web application to be developed in parallel with the development of the EJBs – the model – wrappers are used as temporary stand-ins to the EJBs during the development of the web application. Later, when the EJBs are completed, these model objects can be mapped or delegated on to the actual EJBs.
The majority of EJBs are developed in Chapter 5. The EJBs in this part of the sample are largely taken from the original Plants-By-WebSphere example that ships with WebSphere, but have been extended to demonstrate the transactional coordination of updates to the database and JMS queues (as demonstrated in Chapter 7), and the use of relationships. To support the latter concept, the OrderItem bean has been introduced – an Order aggregates multiple OrderItems .
This much of the application is
The messaging EJBs, OrderSender and FulFillOrder , are developed in Chapter 7. This chapter discusses the basics of the Java 2 Connector Architecture but does not develop that into the Plants-By-WebSphere, primarily because doing so would require the introduction of a "sample legacy system" and that would be going into too much detail for this book.
Enabling the Catalog as a web service is developed in Chapter 8. This chapter introduces the PlantsByWebSphereCatalogService composed of the PlantsByWebSphere port type (derived from the Catalog bean) and SOAP binding.
The application will be developed further in Part 3 of the book.
|
|
|