Вы находитесь на странице: 1из 50

PROJECT

Developing Enterprise Applications and Web 1.1


Services Using J2EE Technologies
1.2 Developing Enterprise Applications and Web
Services Using J2EE Technologies
CASE STUDY 1: ABC CORP

Background
Edward Norton established ABC Corp 15 years ago in Houston. Initially, the company
used to manufacture hardware components, such as LAN cards, keyboards, and
sound cards. Over the years, the business of the ABC Corp has expanded and the
company now has three manufacturing plants and several offices in different cities
across US. The company has also started manufacturing other computer products,
such as processors, motherboards, and memory chips.

The Existing System


In the existing system, the products are manufactured at the different
manufacturing plants of ABC Corp. The company has a distribution model in which
the distributors, retailers and the ultimate customers are involved.

The company decides the price of the product on the basis of the following factors:

„The costs involved in the distribution model.


„The various festival seasons discount, which the company wants to offer to the
ultimate customer.

„The geographical location of the place, where the product needs to be


supplied.

„The demand of the product in the market.


„The price that the competitors are offering.
In the current system, as these calculations are performed manually there could be
a possibility that the price calculated is erroneous. It is also possible that the
duplicate data gets stored in multiple files and this leads to data redundancy and
wastage of the storage space. As no security and backup mechanism exist there is
also a chance of data getting tampered or lost.

The Envisioned System


The management of ABC Corp has decided to cut down the business operation costs
so that price of the products can be reduced. As a first step towards reducing the
costs, the company has decided to change the current distribution model to direct
selling. This would eliminate the margins, which were being paid to the distributors
and retailers. To ensure that the direct selling is effective and their customer base

Developing Enterprise Applications and Web 1.3


Services Using J2EE Technologies
does not get affected, the company decided to launch their Website, which will
enable the customers to directly place orders online.
While developing the Website, the following points need to be taken into
consideration:
1. A centralized database to store the product information. Centralized data
storage will help in faster data access and implementing the security
mechanism.

2. An automated price calculation system to calculate the prices of the product


accurately. As the company decides the price of the product on the basis of
the various factors as mentioned above, the costs involved in these factors
may vary from time-time. The online system will take care of updating these
costs accurately and on time. The various role holders at the company who
might be interested in knowing the latest costs can also get the updated
information online.

3. An authentication and authorization module to validate the users and the


buyers credentials to minimize data tampering.

4. The buyers should be facilitated with a mechanism where by they can keep
on adding the products to the shopping cart in a single session. Finally, while
placing the order they may decide to order for all the products added to the
shopping cart or some of them.

5. The payment mechanism has to be online and there should be a provision


for accepting the credit card payments. The system should also provide
functionality for validating the credit card details.

To implement the above functionalities, the Website needs to have the following
modules:
„User authentication and login module: This module will ensure that only the
authorized users are allowed to login and access the Website.

„A new user registration module for registering new users.


„An online catalog module to enable users to browse through various categories
of products.

„A shopping cart module to store the products selected by a user in a session.
„A price calculation module to calculate product prices quickly and accurately.

„A payment module to enable buyers to make online payments.


You can design the online system using a 3-tier architecture, which can consist of
the following components in the different tiers:

1.4 Developing Enterprise Applications and Web


Services Using J2EE Technologies
„Presentation tier: Consisting of servlets and JSPs. JSP pages can be used for
accepting data and displaying final results to the users. Servlets can be used
to manage application flow depending upon the user requests.

„Business logic layer: Consisting of session beans and entity beans. The system
will need to manage transactions while a buyer buys products online. Security
features will also be implemented to secure online payments. Using enterprise
beans for developing the application will help you to take advantage of the
transaction and security features provided by the EJB container in the J2EE
application server.

„Data tier: Consisting of SQL Server 2000 database to store the relevant data.

The following components can be used to perform different operations in the


application:

„Session beans: For computing the price of the product, incorporating the
shopping cart’s functionality, and invoking entity bean methods.

„Entity beans: To store the product, customer, order, and bill information in the
database.

„Servlets and JSP: To call the methods of the session and entity beans and
display the retrieved data to the user.

INSTRUCTOR NOTES

Project Activities
The students will get 8 hours to complete the project. The activities to be performed
during this period are:
a. Analyze the case study to identify the system processes.
b. Create the technology diagram that represents the various technologies
used at the different tiers of the application and to display the interaction
among various layers of the N-tier application.
c. Create a flow diagram, representing the logical flow of the application.
d. Create a use case diagram, representing the functional requirements of
the application.
e. Create a sequence diagram of the application architecture.
f. Create the database in SQL Server 2000.
g. Create the login module using JSP, servlet, session bean, and entity
bean.

Developing Enterprise Applications and Web 1.5


Services Using J2EE Technologies
h. Create the registration module by using JSP, servlet, session bean and
entity bean.
i. Create the online catalog module using JSP, servlet, session bean and
entity bean.
j. Create the shopping cart module using JSP, servlet, and session bean.
k. Create the payment module using JSP, servlet, session bean and entity
bean.
l. Create the price module using JSP, servlet, session bean and entity
bean.
m. Create the project documentation by using the formats provided in the
later section.
n. Present the project to the faculty. The faculty will assign marks based on
the evaluation criteria’s specified in this section.

1.6 Developing Enterprise Applications and Web


Services Using J2EE Technologies
CASE STUDY 2: MCGRAW LIBRARY

Background
Joseph McGraw established McGraw Library in 1960 in Atlanta. Since then, the
library has seen consistent growth in the number of members and books. Currently
the library has a collection of over 50,000 books on various topics. The library also
has a collection of audiocassettes, and CDs. The library has a subscription for more
than 100 magazines and journals per month.

The Existing System


In the existing system, the librarians maintain the manual records of the books,
audiocassettes, and CDs. The information about the members is also maintained
manually. As the information that needs to be maintained is increasing, it becomes
difficult to maintain them manually and has become very time consuming.

The existing system has the following disadvantages:

„The process of registering new members is slow because a number of forms


need to be filled up.

„The catalog of the books is comprehensive. As a result, searching the catalog


for specific information is a time consuming process.

„To maintain library members data, such as membership id, books issued,
return date, manually in registers is time consuming.

„Members have to visit the library for performing simple tasks, such as viewing
the catalog, return date for the books issued to them, and fine amount.

„Librarians have to manually check all the entries in the books issued register,
to determine which book has been issued to which user.

The Envisioned System


As is evident from the existing system, storing and maintaining book, CDs,
audiocassettes, and membership details, manually, is a time-consuming process.
Moreover, the library members have to visit the library each time they want to view
information about a book they want. Many times, this limitation discourages the
members from distant places to join the library. After looking into the various
bottlenecks of the existing system, the senior management of McGraw library has
decided to develop an Online Library Management System, using which the library
management process will be automated. The new system will have the following
features:

Developing Enterprise Applications and Web 1.7


Services Using J2EE Technologies
1. An online catalog using which library members can search for books,
audiocassettes or CDs. Library members will no more be required to search
for books, audiocassettes and CDs from the huge list stored in the library
registers. The new system will minimize searching time as members can
refine searching by author name, subject name and singer name.

2. Library members need to register to the new Online Library System in order
to issue and return books online. Unregistered members should be denied
access to the Online Library System.

3. A centralized database to store books, CDs, audiocassettes and registered


member information. Centralized data storage will help in faster data access
and in implementing security measures to secure the data stored.

4. Library members can issue and return books online using the new online
library system. Issued books will be delivered through courier. Books can be
returned by library members through courier. They need to provide the
details of the courier’s parcel dispatch number while returning books online.
To provide all the envisioned functionalities, the system should have following
modules:
„A login module for authenticating the credentials of the library members and
for allowing only registered members to login and access the online library
system.

„An online search module to search for books, magazines, and CDs. The search
module will search for books, CDs by author name, book name, subject name,
singer name and music type.

„A new registration module to register library members. Existing members need
to register in order to use the online library system. A library member has to
fill an online form and pay the registration charges using credit card.

„An add module using which librarians can add and remove books,
audiocassettes and CD related information from the database. Entries for new
books, audiocassettes and CDs will be entered in the database using this
module. Existing information in the database can also be updated using this
module.

„A book issue-return module using which books can be issued and returned
online.

The application will use the 3-tier architecture and the following components will be
used in the three tiers of the application:

1.8 Developing Enterprise Applications and Web


Services Using J2EE Technologies
„Presentation tier: Consisting of Sevlets and JSPs. JSP pages can be used for
accepting the data and displaying the final results to the users. Servlets can be
used to manage application flow depending upon user requests.

„Business logic layer: Consisting of session beans and entity beans. The system
will need to manage transactions while a library member issues books,
audiocassettes and CDs. Security features will also need to be implemented to
secure online payments. Using enterprise beans will help the application to
take advantage of the transaction and security features provided by the EJB
Container in the J2EE Application Server.

„Data tier: Consisting of SQL Server 2000 database will help to store the
relevant data.

The above components can be used to perform the following operations in the
application:

„Session beans: For computing membership registration charges, late fines in


case of delays in returning books, and invoking entity bean methods.

„Entity beans: Store library member registration data, book data, CDs data,
issued books data, and returned books data in the database.

„Servlets and JSP: Call the methods of the session and entity beans and display
the retrieved data to the user.

INSTRUCTOR NOTES

Project Activities
The students will get 8 hours to complete the project. The activities to be performed
during this period are:
a. Analyze the case study to identify the system processes.
b. Create a technology diagram representing the technologies used at
various tiers of the application and display the interaction among various
layers of the 3-tier application.
c. Create a flow diagram that represents the logical flow of the application.
d. Create a use case diagram representing the functional requirements of
the application.
e. Create a sequence diagram of the application architecture.
f. Create the login module containing JSP, servlet, session bean and entity
bean.

Developing Enterprise Applications and Web 1.9


Services Using J2EE Technologies
g. Create the registration module using JSP, servlet, session bean and
entity bean.
h. Create the search module using JSP, servlet, session bean and entity
bean.
i. Create the librarian module to add and update book, CD information
using JSP, servlet, session bean and entity bean.
j. Create the book issue, return module using JSP, servlet, session bean
and entity bean.
k. Create the project documentation by using the formats provided in the
later section.
Present the project to the faculty. The faculty will assign marks based on the
evaluation criteria’s specified in this section.

1.10 Developing Enterprise Applications and Web


Services Using J2EE Technologies
CASE STUDY 3: SKY PUBLISHERS

Background
Sky Publishers started as a small publishing house in year 1998 in New York City.
Initially, Sky Publishers had only one printing unit and added two more as business
expanded. Today Sky Publishers has a large number of clients across Europe and
United States.

The Existing System


Sky Publishers takes publishing orders from clients to publish various types of
materials such as magazines, books, and newspapers. Sky Publishers divides the
publishing orders between its printing units depending upon the type of material to
be printed.

In the existing system, Sky Publisher’s maintain manual records of information


about various processes associated with printing, such as the publishing orders
received from the customers, the printing orders sent to the different printing units,
status of the printed materials delivered by the printing units, delivery status to the
customers and payments received from the customers. Information is stored in files.
Separate files are used for each separate process. With increasing number of
customers and workload, number of files has increased drastically. Proper update
and maintenance of all the files has become a big concern for the management.

The Envisioned System


The management of Sky Publishers wants to develop an automated system for
handling the data associated with the different publishing operations. The
management has identified certain drawbacks of the existing system, which are:

„Manual data entry in files is time consuming.

„Information stored in files can be accessed by anyone.


„Retreiving information from files is both time consuming and difficult.

„Keeping track of the work distributed among the printing units is difficult.

The proposed new system will do away with the practice of storing information in
files and instead store information in a centralized database. This will help in easy
data retrieval and maintenance. Securing data will also become easier by
implementing authentication and authorization techniques.

Developing Enterprise Applications and Web 1.11


Services Using J2EE Technologies
The new system will have the following modules:

1. A login module to verify the credentials of users before granting them rights
to access or modify data. The new system will store and use publishing
related information from a centralized database. This will ensure the security
of the data.

2. A new user registration module to register new users with the system.

3. A publishing order module to store the details of the orders received from
clients. Sky Publisher’s receive publishing orders from various clients and
want the information to be stored in the database for future reference.

4. A printing unit details module to store Sky Publishers printing units details in
the database which will simplify the process of distributing work among the
different printing units.

5. A status module to keep track of the status of orders. This will help Sky
Publishers in timely delivery of orders to clients.

6. A delivery module to store information of the orders delivered to the clients.

7. A payment module for calculating publication cost and for storing payment
information received from clients.

The new system can be designed using a 3-tier architecture and developed using the
following components:

„Presentation tier: Consisting of Servlets and JSPs. JSP pages can be used for
accepting the data and displaying the final results to the users. Servlets can be
used to manage application flow depending upon user requests.

„Business logic layer: Consisting of session beans and entity beans. The system
will need to manage transactions while a user places a publishing order.
Security features will also need to be implemented to secure online payments.
Using enterprise beans will help the application to take advantage of the
transaction and security features provided by the EJB Container in the J2EE
Application Server.

„Data tier: Consisting of SQL Server 2000 database to store the relevant data.

The above components can be used to perform the following operations in the
application:

„Session beans: For computing publication cost, keeping track of the work
distributed among the printing units, and invoking entity bean methods.

„Entity beans: Store user registration data, printing order data, printing units’
details, delivery status module, and payment information data in the database.

1.12 Developing Enterprise Applications and Web


Services Using J2EE Technologies
„Servlets and JSP: Call the methods of the session and entity beans and display
the retrieved data to the user.

INSTRUCTOR NOTES

Project Activities
The students will get 8 hours to complete the project. The activities to be performed
during this period are:
a. Analyze the case study to identify the system processes.
b. Create a technology diagram representing the technologies used at
various tiers of the application and display the interaction among various
layers of the 3-tier application.
c. Create a flow diagram that represents the logical flow of the application.
d. Create a use case diagram representing the functional requirements of
the application.
e. Create a sequence diagram of the application architecture.
f. Create the login module using JSP, servlet, session bean and entity
bean.
g. Create the registration module using JSP, servlet, session bean and
entity bean.
h. Create a module to store publishing order received from clients using
JSP, servlet, session bean and entity bean.
i. Create a module to store Sky Publishers printing units details using JSP,
servlet, session bean and entity bean.
j. Create a module to store printing order status using JSP, servlet, session
bean and entity bean.
k. Create a module to store publishing order’s delivery status using JSP,
servlet, session bean and entity bean.
l. Create the payment module using JSP, servlet, session bean and entity
bean.
m. Create the project documentation by using the formats provided in the
later section.
n. Present the project to the faculty. The faculty will assign marks based on
the evaluation criteria’s specified in this section.

Developing Enterprise Applications and Web 1.13


Services Using J2EE Technologies
PROJECT EXECUTION

This book contains four case studies. These case studies will be allocated to each
student. The student can start working on the project after the completion of the
third cycle that is the lesson on Entity Beans.

Phases in Project Execution


The project will be carried out in the following phases:

„System Analysis: This phase involves conducting a detailed study of the


existing system to depict the functionality of the system. The analysis phase is
the most crucial phase in a project because it helps developers to identify
various processes and their function in the system. The project teams will
analyze the existing system along with its shortcomings before moving on to
the development phase.

„Development: This phase involves developing the project based on business


specifications.

„Testing and debugging: This phase involves testing the project before
submitting it to the coordinator.

„Documentation: This phase involves documentation of the entire project life


cycle starting from the system analysis phase to the testing phase.
Documentation is one of the most important aspects of computer
programming. The project documentation should be submitted to the
coordinator in the formats given in this book before the project walkthrough.
The blank report following the case studies is to be filled up, detached from the
book, and submitted on the given date.

Project Evaluation Guidelines


The project is to be evaluated based on the following parameters:

„Quality: Conformance to the requirements of the case study – 40 marks


x The solution maps to the requirements specified in the case study.
x The technologies selected are correct according to the requirements of the
case study.
x The code is optimized.
„Timeliness - 10 marks
x Timely completion of the project

1.14 Developing Enterprise Applications and Web


Services Using J2EE Technologies
„Quality of documentation - 30 marks
x Completion of all formats.
x Correctness of various diagrams, such as technology diagram, flow
diagram, case diagram, sequence diagram, ER diagram, and table
relationship diagram.
x Adherence to standards and processes.
„Query handling during project walkthrough - 20 marks

Project Standards and Guidelines


This project requires knowledge of almost all the technologies and architectures you
have learned during the course. For example, you might use CMP entity beans to
store information in the database. You can use session beans to invoke entity bean
methods. Servlets can be used for accepting end user input and invoking session
bean methods. You can use HTML or JSP whenever you need to focus on the
presentation aspect of the application data.

You need to decide which programming techniques, paradigms, and architectures to


use. Here we will give you hints about the technologies that are appropriate for
different programming aspects. You can use MS-SQL Server 2000 to store the
database that you will use.

You can use Unified Modeling language (UML), which you learned in the earlier
course, to design the use case and sequence diagrams.

Once your project design is ready, you can decide upon the different technologies to
be used to implement the different project functionalities. We suggest the following
technologies:

1. You can use CMP entity beans to store and retreive data from the database.

2. You can use session beans to invoke entity bean methods.

3. You can use servlets for validating user input, and invoking session bean
methods.

4. You can use HTML or JSP pages for accepting user input and displaying
results.

Project Activities
The students will get 8 hours to complete the project. The activities to be performed
during this period are:
o. Analyze the case study to identify the system processes.

Developing Enterprise Applications and Web 1.15


Services Using J2EE Technologies
p. Create the technology diagram that represents the various
technologies used at the different tiers of the application and to
display the interaction among various layers of the N-tier application.
q. Create a flow diagram, representing the logical flow of the
application.
r. Create a use case diagram, representing the functional requirements
of the application.
s. Create a sequence diagram of the application architecture.
t. Create the database in SQL Server 2000.
u. Create the login module using JSP, servlet, session bean, and entity
bean.
v. Create the registration module by using JSP, servlet, session bean
and entity bean.
w. Create the online catalog module using JSP, servlet, session bean
and entity bean.
x. Create the shopping cart module using JSP, servlet, and session
bean.
y. Create the payment module using JSP, servlet, session bean and
entity bean.
z. Create the price module using JSP, servlet, session bean and entity
bean.
aa. Create the project documentation by using the formats provided in
the later section.
bb. Present the project to the faculty. The faculty will assign marks
based on the evaluation criteria’s specified in this section.

Project Timelines
The students should ensure that they complete the following activities before
beginning with the actual coding of the system:

„Analysis of the case study


„Technology architecture design
Session Task to be Performed
#

1 „Create the new registration module.


„Create the login module.
2 „Create the online catalog module/ search
module/ publishing order module.

3 „Create the shopping cart module/ librarian


module/ printing units details module.

1.16 Developing Enterprise Applications and Web


Services Using J2EE Technologies
Session Task to be Performed
#

4 „Create the price module/ book issue-return


module/ printing status and delivery status
module.

„Create the payment module.


„Deploy the application.

„Test the application.


„Debug the application.

Developing Enterprise Applications and Web 1.17


Services Using J2EE Technologies
CASE STUDY 4: BLUEMOON AUTOMOBILES
PURCHASE ORDER MODULE

Background
BlueMoon Automobiles started out as a workshop for repairing four wheelers in
1972. From 1980 onwards, they started manufacturing their own cars. Their cars
became popular due to their designs and fuel efficiency. Their business has been
growing at a steady pace. Therefore, they have expanded their business setup. They
now have various manufacturing divisions and several other distribution centers. The
manufacturing divisions acquire the automobile sub-parts from various local
manufacturers.

The Existing System


As the number of cars being sold continues to increase, the manufacturing plants of
BlueMoon Automobiles is finding it difficult to manufacture all the automobile parts.
To reduce workload, BlueMoon Automobiles has started acquiring automobile parts
from various local manufacturers.

In the current system, BlueMoon Automobiles maintains a list of suppliers in files.


Whenever an automobile part is to be acquired, a person from the accounts
department finds an appropriate manufacturer and places an order with them. Every
employee in the accounts department is not authorized to generate purchase orders.
But in the present system, no checks exist to verify the credentials of the employees
generating the purchase orders. Also, as the details of the manufacturer are
maintained in the files, it takes a huge time to search for an appropriate
manufacturer. Selecting incorrect manufacturers lead to placing an order with the
manufacturer who is not dealing in that product at all.

The Envisioned System


The management of BlueMoon Automobiles wants to implement time and cost saving
measures to increase business profits. The management plans to store the
manufacturer and purchase order information in a database. The management has
decided to automate the process of selecting manufacturers and generating
purchase orders so that an employee generating purchase order is not required to
manually search for the list of manufacturers. To secure the process of generating
purchase order, the management wants to authenticate the credentials of the
employee generating the purchase order.

The management has decided to develop a purchase order module for BlueMoon
Automobiles, which will automate the process of selecting manufacturers and

1.18 Developing Enterprise Applications and Web


Services Using J2EE Technologies
generating purchase orders. Registered employees need to first authenticate their
credentials before generating purchase orders. A list of manufacturers dealing in a
particular product can be viewed by selecting the product type. Purchase order can
be generated by selecting a manufacturer from the list displayed and by filling a
purchase order form.

To provide the envisioned functionalities, the purchase order module should have
following features:

1. In the new system, the accounts department employees, authorized to


generate purchase orders need to first register themselves in the purchase
order module. After registering, they are authorized to view manufacturers
list and generate purchase order.

2. The system should have a mechanism to authenticate credentials of


registered employees. This will ensure that purchase orders get generated
by authorized employees only.

3. The system should maintain the details of registered employee,


manufacturer information, and purchase order information in a centralized
database. The details of registered employee information to be stored
includes employee id, employee name, and password. The details of
manufacturer information to be stored includes manufacturer id,
manufacturer name, product type, and address. The details of purchase
order information stored includes purchase order id, customer id,
manufacturer id, manufacturer name, product type, and quantity.

4. The system should have a mechanism to display a list of the manufacturers,


depending upon product type.

5. The system should have a mechansim to generate purchase orders


automatically. Employees can generate a purchase order by simply filling a
purchase order form.

To implement all the features, the Purchase Order Module needs to have the
following components:

1. Registration component to register account department employees with the


new system.

2. Login component to check the credentials of registered employees before


granting them rights to view manufacturer list and generate purchase order.

3. Manufacturer list component to view manufacturers list depending upon


product type.

4. Purchase order generation component to generate purchase orders.

Developing Enterprise Applications and Web 1.19


Services Using J2EE Technologies
SOLUTION TO CASE STUDY 4 – BLUEMOON
AUTOMOBILES PURCHASE ORDER MODULE

To create the Purchase Order Module, you need to make use of the HTML files,
servlet, JSP file, session bean, and entity beans.

1. start.html: Contains the code to create the welcome page of the purchase
order module. It displays two links, New Registration and Registered
Employees Login.

2. Login.html: Contains the code to display the login page from where a
registered employee can login to the application.

3. Registration.html: Contains the code to display the registration form,


which enables employees to register with the purchase order module. The
user after filling the form clicks the Submit button to transfer the employee
registration information to the MainServlet.java.

4. product.jsp: Contains the code to display product type, accept user’s choice
of product, and transfer product information to the MainServlet.java file.

5. MainServlet.java: Contains the code to accept user input and invoke the
methods of the session bean, ProductSession, to implement various
functionalities of the application.

6. ProductSession.java: Contains the code to declare the business methods


to be used for invoking the entity bean methods to store and retreive data
from the database.

7. ProductSessionHome.java: Contains the code to retreive session bean


remote interface reference.

8. ProductSessionBean.java: Contains the code to define business methods


to access the entity beans: Customer, Supplier, and PurchaseOrder.

9. Customer.java: Contains the code to declare the get and set methods for
the customer bean’s fields.

10. CustomerHome.java: Contains the code to declare the create() and


findByPrimaryKey() methods of the customer entity bean.

11. CustomerBean.java: Contains the code to stiore new employee registration


information in the database.

1.20 Developing Enterprise Applications and Web


Services Using J2EE Technologies
12. Supplier.java: Contains the code to declare the get and set methods for the
supplier bean’s fields.

13. SupplierHome.java: Contains the code to declare the create() and


findByPrimaryKey() methods of the supplier entity bean.

14. SupplierBean.java: Contains the code to store supplier information in the


database.

15. PurchaseOrder.java: Contains the code to declare the get and set methods
for the purchaseorder bean’s fields.

16. PurchaseOrderHome.java: Contains the code to declare the create() and


findByPrimaryKey() methods of the purchaseorder entity bean.

17. PurchaseOrderBean.java: Contains the code to store purchase order


information in the database.

INSTRUCTOR NOTES

Setup Requirements

„Ensure the following before conducting the session:


x J2EE 1.4 Application Server Developer Edition and J2SDK 1.4.2 is installed
on the faculty node.
x MS SQL Server 2000 is installed on the faculty node and is currently
running. SQL Client should be installed on the student node.
x You have copied all the data files and sub folders from the \Project
Solutions folder of TIRM CD.
x You have copied all the .sql script files from the \Database
Scripts\J2EE3_PROJECT folder of TIRM CD.

Deploying the Purchase Order Module Application

Before deploying the purchase order module application, you need to compile the
enterprise bean Java files using the javac compiler.
You need to ensure that the classpath contains the build
directory and the j2ee.jar file of the lib directory of your J2EE
application server.

Developing Enterprise Applications and Web 1.21


Services Using J2EE Technologies
To deploy the purchase order module application, perform the following steps:

1. Create a new .ear file for the project using the New Application Wizard
dialog box.

2. Create a JAR file for the customer CMP entity bean using the New
Enterprise Bean Wizard dialog box. The JAR file of the customer CMP
entity bean will contain the class files Customer.class,
CustomerHome.class, and CustomerBean.class.

3. Create a JAR file for the supplier CMP entity bean using the New Enterprise
Bean Wizard dialog box. The JAR file of the supplier CMP entity bean will
contain the class files Supplier.class, SupplierHome.class, and
SupplierBean.class.

4. Create a JAR file for the purchaseorder CMP entity bean using the New
Enterprise Bean Wizard dialog box. The JAR file of the purchaseorder CMP
entity bean will contain the class files PurchaseOrder.class,
PurchaseOrderHome.class, and PurchaseOrderBean.class.

5. Select Sun–specific settings tab for customer, supplier and purchaseorder


CMP entity beans and map the entity beans with SQL Server 2000 database.
Select both the database schema file and the MSSQL database while
mapping the entity beans with the database.

6. Create a JAR file for the productsession session bean using the New
Enterprise Bean Wizard dialog box. The JAR file will contain the class files
ProductSession.class, ProductSessionHome.class, and
ProductSessionBean.class.

7. Set enterprise bean reference for the productsession session bean with the
customer, supplier, and purchaseorder CMP entity beans using the EJB Refs
tab. Enter the Coded Name as ejb/customerlist while setting reference of
the productsession session bean with the customer entity bean and select
the ejb-jar-ic.jar#CustomerBean from the Enterprise Bean Name drop
down box. Enter the Coded Name as ejb/supplierlist while setting
reference of the productsession session bean with the supplier entity bean
and select the ejb-jar-ic.jar#SupplierBean from the Enterprise Bean
Name drop down box. Enter the Coded Name as ejb/purchaseorder while
setting reference of the productsession session bean with the purchaseorder
entity bean and select the ejb-jar-ic.jar#PurchaseOrderBean from the
Enterprise Bean Name drop down box.

8. Create a WAR file to store the start.html, Login.html,


registration.html, product.jsp files and the MainServlet.class file
using the New Web Application Wizard dialog box.

1.22 Developing Enterprise Applications and Web


Services Using J2EE Technologies
9. Select the EJB Refs tab for the WAR file to set the enterprise bean reference
for the MainServlet servlet with the productsession session bean. Enter the
Coded Name as ejb/productsession while setting reference of the
MainServlet servlet with the productsession session bean and select the
ejb-jar-ic.jar#ProductSessionBean from the Enterprise Bean Name
drop down box.

10. Specify projectctx as the context root of the WAR file and the start.html
file as the welcome file.

11. Save the application using the FileÆSave command.

12. Select the ToolsÆDeploy command to deploy the purchase order module
application.

„Run the SQL script INSTALLJ2EE3_PROJECT batch file to create the


database J2EE3_PROJECT and the related tables.

„In J2EE 1.4 Admin Console change database name to J2EE3_PROJECT for
connection pooling.

Run the Purchase Order Module Application

Before running the application, double click the batch file, InsertSupplierData
from the folder /Database scripts/J2EE3_PROJECT of the TIRM CD, to insert
manufacturer data in the supplier table. Type the following URL in the browser
window to run the purchase order module application:
http://localhost:8080/projectctx
The following figure shows the home page of the purchase order module application:

Developing Enterprise Applications and Web 1.23


Services Using J2EE Technologies
Home Page of Purchase Order Module Application

1.24 Developing Enterprise Applications and Web


Services Using J2EE Technologies
SAMPLE PROJECT DOCUMENTATION:
BLUEMOON AUTOMOBILES PURCHASE
ORDER MODULE

PROJECT ON
BlueMoon Automobiles Purchase Order Module

Developed by

Name: Michael John

Reg. No.: 6709-50-386

Developing Enterprise Applications and Web 1.25


Services Using J2EE Technologies
BlueMoon Purchase Order Module
(Project Title)

Batch Code : B010101


Start Date : June 1, 2004
End Date : June 10, 2004
Name of the Coordinator : Alex Norton
Name of Developer : Michael John
Date of Submission : June 11, 2004

1.26 Developing Enterprise Applications and Web


Services Using J2EE Technologies
CERTIFICATE

This is to certify that this report titled BlueMoon Purchase Order


Module embodies the original work done by Debbie Howe in partial
fulfillment of his course requirement at NIIT.

Coordinator:
Alex Norton

Developing Enterprise Applications and Web 1.27


Services Using J2EE Technologies
ACKNOWLEDGEMENT

We have benefited from the feedback and suggestions given to


us by Mr. Alex Norton and other faculty members.

1.28 Developing Enterprise Applications and Web


Services Using J2EE Technologies
SYSTEM ANALYSIS

System Summary: BlueMoon Automobiles Purchase Order Module is


an online module that enables users to generate purchase orders. The
application stores the details of the employees, manufacturers, and
purchase orders in the SQL Server 2000 database.

Developing Enterprise Applications and Web 1.29


Services Using J2EE Technologies
TECHNOLOGY DIAGRAM

Top Level Diagram representing the technologies used to develop a


J2EE EJB application.

1.30 Developing Enterprise Applications and Web


Services Using J2EE Technologies
USE CASE DIAGRAM

Use case Diagram representing the functional relationship among


various actors in the system.

Developing Enterprise Applications and Web 1.31


Services Using J2EE Technologies
SEQUENCE DIAGRAM

New employee registration

1.32 Developing Enterprise Applications and Web


Services Using J2EE Technologies
SEQUENCE DIAGRAM
Displaying manufacturer list

Developing Enterprise Applications and Web 1.33


Services Using J2EE Technologies
SEQUENCE DIAGRAM
Storing purchase order information in the database

1.34 Developing Enterprise Applications and Web


Services Using J2EE Technologies
LOGICAL FLOW DIAGRAM

Logical Flow Diagram representing the control flow of purchase


order module.

Developing Enterprise Applications and Web 1.35


Services Using J2EE Technologies
CONFIGURATION

Hardware: PC compatible with a Intel Pentium-III processor, 128-MB


RAM, and 20GB of Hard disk

Operating system: Windows 2000 Professional

Software: J2EE 1.4 Application Server and J2SDK1.4.2

1.36 Developing Enterprise Applications and Web


Services Using J2EE Technologies
PROJECT FILE DETAILS
S.No File Name Remarks

1 start.html Displays the welcome page of


the purchase order module
application.
2 Login.html Provides a login page for the
user.
3 Registration.html Provides a page for registering
a new user.
4 product.jsp Displays various product types
supplied by the
manufacturers.
5 MainServlet.java Accepts the user input and
invokes session bean
methods.
6 ProductSession.java Declares the methods
invoking various CMP entity
beans.
7 ProductSessionHome.java Declares a method to return
the reference of
productsession session bean
remote interface.
8 ProductSessionBean.java Defines the methods to locate
and invoke customer, supplier
and purchaseorder CMP entity
beans.
9 Customer.java Declares the get and set
methods for customer entity
bean fields.
10 CustomerHome.java Declares the create() and
findByPrimaryKey() methods
of the customer entity bean.
11 CustomerBean.java Declares methods to store
customer information in the

Developing Enterprise Applications and Web 1.37


Services Using J2EE Technologies
database.

12 Supplier.java Declares the get and set


methods for supplier entity
bean fields.
13 SupplierHome.java Declares the create(),
findByPrimaryKey(), and
findByProduct() methods of
the supplier entity bean.
14 SupplierBean.java Declares methods to access
manufacturer information
from the database.
15 PurchaseOrder.java Declares the get and set
methods for purchaseorder
entity bean’s fields
16 PurchaseOrderHome.java Declares the create() and
findByPrimaryKey() methods
of the purchaseorder entity
bean
17 PurchaseOrderBean.java Declares methods to store
purchaseorder information in
the database.

1.38 Developing Enterprise Applications and Web


Services Using J2EE Technologies
BLANK DOCUMENTATION FORMATS

PROJECT ON

Developed by

Name:

Reg. No.:

Developing Enterprise Applications and Web 1.39


Services Using J2EE Technologies
(Project Title)

Batch Code :
Start Date :
End Date :
Name of the Coordinator :
Name of Developer :
Date of Submission :

1.40 Developing Enterprise Applications and Web


Services Using J2EE Technologies
CERTIFICATE

This is to certify that this report titled ______________ is the


original work done by ____________ and _____________in
partial fulfillment of their course requirement at NIIT.

Coordinator:

Developing Enterprise Applications and Web 1.41


Services Using J2EE Technologies
ACKNOWLEDGEMENT

1.42 Developing Enterprise Applications and Web


Services Using J2EE Technologies
SYSTEM ANALYSIS

System Summary:

Developing Enterprise Applications and Web 1.43


Services Using J2EE Technologies
TECHNOLOGY DIAGRAM

Top Level Diagram representing the technologies used to


develop the application.

1.44 Developing Enterprise Applications and Web


Services Using J2EE Technologies
USE CASE DIAGRAM

Use case Diagram representing the functional relationship


among various actors in the system.

Developing Enterprise Applications and Web 1.45


Services Using J2EE Technologies
SEQUENCE DIAGRAM

Sequence Diagram

1.46 Developing Enterprise Applications and Web


Services Using J2EE Technologies
LOGICAL FLOW DIAGRAM

Logical Flow Diagram representing the control flow the


application.

Developing Enterprise Applications and Web 1.47


Services Using J2EE Technologies
CONFIGURATION

Hardware:

Operating system:

Software:

1.48 Developing Enterprise Applications and Web


Services Using J2EE Technologies
PROJECT FILE DETAILS
S.No File Name Remarks

Developing Enterprise Applications and Web 1.49


Services Using J2EE Technologies
1.50 Developing Enterprise Applications and Web
Services Using J2EE Technologies

Вам также может понравиться