Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Upgrade and Migration Guide

- Previous: Application Navigation and Logic
- Next: Potential Migration Issues

# Application Components

## Data Components

Each table in the database schema is encapsulated as an entity bean:

Entity Bean | Database Table
Account | ACCOUNT table
AccountType | ACCOUNT_TYPE table
Branch | BRANCH table
Customer | CUSTOMER table
Transaction | TRANSACTION_HISTORY table
TransactionType | TRANSACTION_TYPE table

All entity beans use container-managed persistence (CMP), except `Customer`, which uses bean-managed persistence (BMP).

Currently, the application only makes use of the `Account, AccountType, Branch,` and `Customer` beans.

## Business Components

Business components of the application are encapsulated by session beans.

The `BankTeller` bean is a stateful session bean that encapsulates all interaction between the customer and the system. `BankTeller` is notably in charge of the following activities:

- Authenticating a customer through the `authCheck()` method

- Giving the list of accounts for the customer through the `getAccountSummary()` method

- Transferring funds between accounts on behalf of the customer through the `transferFunds()` method

The `InterestCalculator` bean is a stateless session bean that encapsulates financial calculations. It is responsible for providing the compound interest projection calculations, through the `projectEarnings()` method.

## Application Logic Components (Servlets)

Component name | Purpose
LoginServlet | Authenticates the user with the BankTeller session bean (`authCheck()` method), creates the HTTP session and saves information pertaining to the user in the session.Upon successful authentication, forwards request to the main menu page (`UserMenu.jsp`)
CustomerProfileServlet | Retrieves customer and branch details from the Customer and Branch entity beans and forwards request to the view/edit details page (`CustomerProfile.jsp`).
UpdateCustomerDetailsServlet | Attempts to effect customer details changes amended in `CustomerProfile.jsp` by updating the Customer entity bean after checking validity of changes. Redirects to `UpdatedDetails.jsp` if success, or to `DetailsUpdateFailed.jsp` in case of incorrect input.
ShowAccountSummaryServlet | Retrieves the list of customer accounts from the BankTeller session bean (`getAccountSummary()` method) and forwards request to `AccountSummary.jsp` for display.
TransferFundsServlet | Retrieves the list of customer accounts from the BankTeller session bean (`getAccountSummary()` method) and forwards request to `TransferFunds.jsp` allowing the user to set up the transfer operation.
CheckTransferServlet | Checks the validity of source and destination accounts selected by the user for transfer and the amount entered. Calls the `transferFunds()` method of the BankTeller session bean to perform the transfer operation. Redirects the user to `CheckTransferFailed.jsp` in case of input error or processing error, or to `TransferSuccess.jsp` if the operation was successfully carried out.
ProjectEarningsServlet | Retrieves the interest calculation parameters defined by the user in InterestCalc.jsp and calls the `projectEarnings()` method of the InterestCalculator stateless session bean to perform the calculation, and forwards results to the `ShowProjectionResults.jsp` page for display. In case of invalid input, redirects to `BadIntCalcInput.jsp`

## Presentation Logic Components (JSP Pages)

Component name | Purpose
`index.jsp` | Index page to the application that also serves as the login page.
`LoginError.jsp` | Login error page displayed in case of invalid user credentials supplied. Prints an indication as to why login was unsuccessful.
`Header.jsp` | Page header that is dynamically included in every HTML page of the application
`CheckSession.jsp` | This page is statically included in every page in the application and serves to verify whether the user is logged in (i.e. has a valid HTTP session). If no valid session is active, the user is redirected to the `NotLoggedIn.jsp` page.
`NotLoggedIn.jsp` | Page that the user gets redirected to when they try to access an application page without having gone through the login process first.
`UserMenu.jsp` | Main application menu page that the user gets redirected to after successfully logging in. This page provides links to all available actions.
`CustomerProfile.jsp` | Page displaying editable customer details and static branch details. This page allows the customer to amend their correspondence address.
`UpdatedDetails.jsp` | Page where the user gets redirected to after successfully updating their details.
`DetailsUpdateFailed.jsp` | Page where the user gets redirected if an input error prevents their details to be updated.
`AccountSummaryPage.jsp` | This page displays the list of accounts belonging to the customer in tabular form listing the account no, account type and current balance. Clicking on an account no. in the table causes the application to present a detailed transaction history for the selected account.
`ShowTransactionHistory.jsp` | This page prints the detailed transaction history for a particular account no. The transaction history is printed using a custom tag library.
`TransferFunds.jsp` | This page allows the user to set up a transfer from one account to another for a specific amount of money.
`TransferCheckFailed.jsp` | When the user chooses incorrect settings for fund transfer, they get redirected to this page.
`TransferSuccess.jsp` | When the fund transfer set-up by the user can successfully be carried out, this page will be displayed, showing a confirmation message.
`InterestCalc.jsp` | This page allows the user to enter parameters for a compound interest calculation.
`BadIntCalcInput.jsp` | If the parameters for compound interest calculation are incorrect, the user gets redirected to this page.
`ShowProjectionResults.jsp` | When an interest calculation is successfully carried out, the user is redirected to this page that displays the projection results in tabular form.
`Logout.jsp` | Exit page of the application. This page removes the stateful session bean associated with the user and invalidates the HTTP session.
`Error.jsp` | In case of unexpected application error, the user will be redirected to this page that will print details about the exception that occurred.

- Previous: Application Navigation and Logic
- Next: Potential Migration Issues

- © 2010, Oracle Corporation and/or its affiliates