Chapter 1 introduced the XBikes sample application as an e-commerce enabled Web site through which you can simulate buying bicycles and related accessories. XBikes is a three-tier distributed application that creates the Downhill Bikes online bicycle store.
There are two versions of the XBikes application, one built on the .NET Framework and one built on J2EE, both of which are functionally equivalent. Two teams of developers created these versions to demonstrate the following interoperability scenarios:
You have an existing J2EE application and you want to add .NET Framework elements.
You have an existing .NET Framework application and you want to add J2EE elements.
The Downhill Bikes online store is loosely based on a sample application also called Downhill Bikes, part of the original version of Visual Studio .NET and the .NET Framework 1.0. The first implementation of Downhill Bikes was a .NET Framework application designed to show off the features of the then new Web application framework, ASP.NET.
Although XBikes implements the user interface from Downhill Bikes, it is important to note that both the .NET Framework and Java versions of XBikes were designed and built from scratch to demonstrate interoperability techniques.
The reworked sample application took the name XBikes or “CrossBikes” to reflect its new purpose in life, which is to demonstrate cross-platform interoperability.
The Java developers implemented the J2EE version of XBikes using best practice recommendations from Sun and IBM. Likewise, the .NET Framework developers implemented the .NET Framework version using the equivalent Microsoft patterns. Taking the two functionally equivalent versions, the developers then re-engineered both the .NET Framework and Java applications to implement multiple interoperability techniques, so that application elements in one environment can call corresponding elements on the alternate technology.
XBikes illustrates multiple interoperability principles, so some design elements in XBikes show several methods of linking J2EE and .NET Framework, whereas in a practical design, you would select only one of these techniques.
The XBikes application design implements the pattern of use cases. Each possible user action, such as logging in or placing an order, is a use case. This equivalence appears in the names and breakdown of the various components within the application. The following are the six use cases or possible user actions in XBikes:
AuthenticateCustomer — Logs a customer into the application.
GetCategories — Returns and displays a list of categories from the product catalog.
GetProductsByCategory — Returns and displays a list of products from the catalog that belong to a specific category.
GetCustomerOrders — Returns and displays a list of all orders a customer has placed.
GetSearchResults — Returns and displays search results from a user initiated product search.
PlaceOrder — Places an order for selected products in the catalog.
While both versions of XBikes provide the functionality of the six use cases, they do not handle some things that are essential to a production environment, such as security. XBikes is only a sample use case implementation to demonstrate interoperability and does not illustrate recommended practice for implementing security in a production application.
The next few sections review architectural best practices for multi-tiered applications in both .NET Framework and Java. These sections contain implementation references to the overall architecture of the two XBikes applications. Chapters 7 to 9 cover the details of how the developers implemented these interoperability components.
The companion CD to this book contains both the .NET Framework and J2EE versions of the XBikes sample application. For information about how to install and configure XBikes, see Appendices A and B.