Docstoc

Project

Document Sample
Project Powered By Docstoc
					PROJECT

   CS 441
SUMMER 2011


              1
          CS 441- PROJECT GENERAL
                 GUIDELINES

•   NOTES:
•   THIS PROJECT IS TO BE DONE INDIVIDUALLY! NO PARTNERS
•   THIS POWER POINT PRESENTATION IS INTENDED TO HELP YOU WITH
    YOUR DESIGN OF THE CLIENT’S GUI ASPECTS OF YOUR PROJECT AND THE
    ARCHITECTURE OF YOUR ENTERPRISE APPLICATION. DEVIATIONS FROM
    THE GUIDELINES IN THIS PRESENTATION AND THE DESCRIPTION WILL
    RESULT IN LOST POINTS.
•   THIS PRESENTATION SHOULD BE USED IN CONJUNCTION WITH THE
    INFORMATION DISCUSSED IN CLASS DURING LECTURES.
•   THIS PROJECT CONSISTS OF A SIMULATED ENTERPRISE APPLICATION FOR
    AN AIRLINE RESERVATION SYSTEM IMPLEMENTED USING ENTERPRISE
    JAVA BEANS WITH NETBEANS BEING THE INTEGRATING
    DEVELOPMENT ENVIRONMENT.




                                                                  2
          CS 441- PROJECT
           OBJECTIVES
• THE PURPOSE OF THE PROJECT IS TO INTRODUCE YOU TO
  ENTERPRISE JAVA BEANS (EJB)
• AS WELL AS THE USAGE OF AN IDE LIKE NETBEANS THAT
  INTEGRADES EJBs.
• IT ALSO INTRODUCES YOU TO THE CONCEPT OF
  DISTRIBUTED APPLICATION SERVERS, THAT ARE USED IN
  THE INDUSTRY TODAY AS A SUBSTITUTE TO RMI SERVERS
  THAT WE HAVE USED THUS FAR .




                                                  3
      CS 441- PROJECT
    DUE DATE AND POINTS
• THIS PROJECT IS WORTH 40 POINTS TOWARDS YOUR FINAL
  GRADE IN THE COURSE.
• THE DUE DATE IS AUGUST 10, 2011.
• YOU SHOULD DO THE FOLLOWING:
   – SHOW UP IN CLASS THAT DAY FOR A LIVE DEMONSTRATION.
     INTERNET STUDENTS COULD MAKE SPECIAL ARRANGEMENTS IF
     THEY CAN’T ATTEND THE CLASS THAT DAY.
   – SUBMIT YOUR FILES ON BLACKBOARD BEFOR ETHE
     DEMONSTARTION.
   – A GRADE WILL BE ISSUES AFTER THE DEMO IS COMPLETED AND A
     REVIEW OF YOUR SUBMITTED FILES IS ACCOMPLISHED BY ME FEW
     DAYS AFTER THE REVIEW. BOTH TASKS ARE NEEDED IN ORDER TO
     RECEIVE A GRADE!!.


                                                                4
          CS 441- PROJECT GENERAL
                DESCRIPTION
• THIS PROJECT CONSISTS OF A SIMULATED ENTERPRISE
  APPLICATION FOR A SIMPLE AIRLINE RESERVATION
  SYSTEM.
• IT SHOULD BE IMPLEMENTED USING NETBEANS 6.5 AND
  UP
• The architecture of the project is discussed in the next
  slides.
• NOTE: The files must be submitted in the form of a
  NetBeans project. It will not be graded if it is not a
  NetBeans project. ( I want to be able to test it by opening it
  and run it with NetBeans). The database must be Derby
  and be part of the NetBeans project files submitted.
                                                               5
 CS 441- PROJECT GENERAL
       DESCRIPTION
• There are two clients:
   – A web client: that is the regular customer contacting the site for
     travel information using the Internet.
   – An application client that represents the administrator. The
     administrator can process queries to add new data (new flight
     information) or delete existing data from the data source or update
     existing data.




                                                                           6
      Example EJB Architecture-Web
                 Client                                                                       DB1



                                                                                    Entity
                                                                                    Bean
                                                            Session
                                                             Bean
                                                  Servlet                                            DB2
     Client’ s
     Browser                           Web
                                      Server                                        Entity
                                                   JSPs                             Bean

                                                             Beans are located in
                                                             Distributed
                                                             Application Servers

                        Internet
Client Tier
(Presentation
Layer) for Web Client              Web Tier                   Business Logic Tier            Data Tier
                                   WHERE WEB
                                   MODULES ARE DEPLOYED


                                                                                                 7
Example EJB Architecture-Application Client
(Admin)- JPA=JAVA PERSISTENCE API
NOTICE THAT THIS CLIENT DOES NOT USE THE INTERNET AND
THERFORE DOES NOT GO THROUGH THE WEB SERVER
                                                                DB1


                                                     Entity
                                                    Bean or
                            Session                   JPA
                             Bean
        Client                                                      DB2

                                                     Entity
                                                    Bean or
                                                      JPA
 Admin client application
                             Beans are located in
                             Distributed
                             Application Servers




                              Business Logic Tier             Data Tier




                                                                          8
  CS 441- PROJECT SPECIFIC
         GUIDELINES

• The components for the web component are:
  – Presentation layer is primarily the code generated by jsp files. The
    GUI is formed by jsp code.
  – There is only one servlet which passes requests to the session bean.
    The session bean communicates with entities (JPA code).
  – The data source is contacted by the proper entities (JPA code)
    corresponding to the tables of your data source.
  – The data source (database) has the schemas (tables and fields in
    each table) described further down in this presentation.


                                                                       9
       CS 441- PROJECT-
FUNCTIONALITY- first presentation to
         the web client
• A user can be either a registered user or a new user.
• The name of the web site is (cs441Airline).
• When the site is contacted:
   – A jsp will first generate a html form giving the two choices to the
     user to enter the web site either as a new customer that needs to
     register or as an already registered customer .
   – The registered customer choice generates an automatic
     authentication panel asking for user id and password (BASIC
     authentication- see security).
       • This should be done via the proper security settings at the web level.
       • It also initiates a session for this customer.


                                                                                  10
 CS 441- PROJECT- FUNCTIONALITY-
second presentation to web client (registered
    customer choice-user authenticated)
 – If the user is authenticated the user can be presented with another
   html form that has 3 fields that ask for the flight information:
   TEXT FIELD 1->DEPARTURE_ CITY
   TEXT FIELD 2->DEPARTURE_DATE
   TEXT FIELD 3-> DESTINATION_CITY
   A submit button is provided to submit the information entered in
   the text fields.
   This presentation also includes a html table that displays the
   available Departure Cities, Destination Cities (the data matches
   what is on the database so that the user can choose valid entries)
   that the airline flies.


                                                                    11
CS 441- PROJECT- FUNCTIONALITY-third
 presentation to web client (registered user-
             selection of flights)
 – SUBMIT TEXT FIELDS BUTTON-> SUBMITS ABOVE INFORMATION TO
   INTERNET SITE’S DATABASE AND ACTIVATES A QUERY ON TABLE
   “Travel_Information” of the database. THAT RESULTS IN SELECTION OF
   VARIOUS FLIGHTS MATCHING THE REQUESTED INFORMATION.
 – THE RESULTS OF THE QUERY ARE SENT TO THE WEB CLIENT AND
   DISPLAYED ON A HTML TABLE GENERATED BY A JSP (third presentation to the
   web client).
     • NOTE: ENTER ENOUGH INFORMATION IN DATABASE SO THAT AT LEAST 4
       SELECTIONS (FOR 4 DIFFERENT FLIGHTS) ARE POSTED ON THE JTABLE.
 – THE FOLLOWING INFORMATION SHOULD BE PRESENTED:




                                                                        12
CS 441- PROJECT- FUNCTIONALITY-third
 presentation to web client (registered user-
             selection of flights)
  DEPARTURE CITY: (SAME AS THE ONE CHOSEN BY CUSTOMER)
    DESTINATION CITY: (SAME AS THE ONE ENTERED BY CUSTOMER)
    DEPARTURE DATE: (SAME AS THE ONE ENTERED BY CUSTOMER)
   FLIGHT            DEPARTURE   ARRIVAL      PRICE (IN US
                                              DOLLARS)
   NUMBER            TIME        TIME
   LIST THE CHOICE
   FOUND IN THE
   DATABASE
   LIST THE CHOICE
   FOUND IN THE
   DATABASE
   LIST THE CHOICE
   FOUND IN THE
   DATABASE
   LIST THE CHOICE
   FOUND IN THE
   DATABASE


                                                              13
CS 441- PROJECT- FUNCTIONALITY-third
 presentation to web client (registered user-
             selection of flights)
  – THE USER CAN CHOOSE WHICH FLIGHT IS PREFERRED AND
    SUBMIT IT TO THE APPLICATION.
     • THE USER CAN SUBMIT THE CHOSEN FLIGHT BY FILLING OUT A HTML
       FORM PROVIDED BY THE WEB SERVER ( ANOTHER JSP). THIS CAN BE DONE
       IN MANY DIFFERENT WAYS. YOU CAN DO IT ANYWAY YOU PREFER.
     • THE DATA SENT BY THE USER IS PROCESSED BY THE SERVLET , THE
       SESSION BEAN AND THE PROPER ENTITY, AND STORED IN THE DATA
       SOURCE (My_Booked_Flights TABLE).

  – The user is sent another page indicating the message:“
    Your_name , You have Booked Your Flight”
    where Your _name is the name of the registered user.
  – At this time the session ends.

                                                                     14
       CS 441- PROJECT-
 FUNCTIONALITY-new web customer
• The new customer choice is processed to the servlet which
  in turn initiates another form via a jsp that requests
  information from the new customer.
   – The data submitted by the new customer is shown on the next
     slide. The data submitted by the customer is processed by the
     servlet to the session bean to the entities and stored in the data
     source (database).
   – A confirmation is given back to the new customer that he/she is
     successfully registered via a jsp web component.
   – Once a new customer is registered , he/she can proceed to login as
     an existing customer from there on, as shown on slide 7 starting
     with the request for login and password data.
                                                                      15
        CS 441- PROJECT-
  FUNCTIONALITY-new web customer
                                           NEW CUSTOMER REGISTRATION PAGE (HTML FORM)


                    Please register by submitting the following information:

 First Name:                                                                    (Text Fields)



  Last Name:



 Choose a UserID:                                                                Use user1, user2, user3 etc as User IDs



Choose password:



                                          SUBMIT
                                                                               Submit button


                                                                                                                  16
           CS 441- PROJECT-
           FUNCTIONALITY
• The session bean has two business logic
  methods:
  –   A business method for new customers
  –   A business method for existing customers.
  –   A statefull bean implements the methods.
  –   Note: you can increase the number of the
      business logic methods as desired by you to
      facilitate the implementation.
                                                    17
CS 441- PROJECT- SECURITY
• Implement three roles for users:
     • new_customer.
     • existing_customer.
     • Admin.
  – Only Admin client can make changes to the
    flight data in the data source. New and existing
    customers can only search the data source for
    flight data.

                                                   18
CS 441- PROJECT- SECURITY
• Realm should be: file
• Authentication should be: BASIC.
• Set a number of users on the application
  server.
• Add the asadmin for the client application
  and add a user id and password for the
  admin role.

                                               19
    CS 441- PROJECT- Client
   Application for Administrator
• This admin client application can be a java
  application program that communicates directly
  with the session bean in the application server.
  The bean returns the records of the database (one
  table at a time) to the client application where they
  get displayed on a JTable.
• The administrator can update (submit update
  query) and insert (submit insert query) into the
  database’s table displayed at a particular time.
                                                      20
           CS 441- PROJECT-
             Environments
• The application should be developed using
  NetBeans 6.5 and up and EE6.
• A project should be created that has 3 parts:
   – A web part
   – A EJB part
   – An application client part.
• The project should be deployable on GlassFish v2
  or GlassFish v3.

                                                  21
      WEB APPLICATION’S DATABASE

•   THE DATA SOURCE SHOULD BE DERBY.
•   IT SHOULD CONTAIN AT LEAST 3 TABLES:
    – TRAVEL_INFORMATION
    – MY_BOOKED_FLIGHTS
    – REGISTERED CUSTOMERS
•   YOU CAN ADD ADDITIONAL TABLES IF YOU NEED THEM FOR
    NORMALIZATION PURPOSES OR FOR LOGGIN INFORMATION (IT IS
    UP TO YOU).




                                                          22
 WEB APPLICATION’S DATABASE
• THE FIELDS IN TRAVEL_INFORMATION ARE:
   –   FLIGHT NUMBER
   –   DEPARTURE_DATE
   –   DEPARTURE_CITY
   –   DESTINATION_CITY
   –   DEPARTURE TIME
   –   ARRIVAL TIME
   –   PRICE ( IN DOLLARS)
   –   YOU CAN ALSO ADD ADDITIONAL FIELDS IF YOU DECIDE THAT ARE
       NEEDED.

• ENTER ENOUGH TEST DATA



                                                                   23
       WEB APPLICATION’S
          DATABASE
• THE FIELDS IN MY_BOOKED_FLIGHTS TABLE ARE:
   – CUSTOMER ID
   – FLIGHT NUMBER
   – DEPARTURE DATE




                                               24
      WEB APPLICATION’S DATABASE

•   NOTICE THAT ONCE THE CUSTOMER MAKES A SELECTION FROM THE
    HTML TABLE FOR SAVINGS IN THE TABLE My_Booked_Flights, THE
    CUSTOMER ‘ s FIRST AND LAST NAMES WILL BE ADDED TO THE TABLE.
    THE CUSTOMER ID SHOULD BE THERE AS A MINIMUM.
•   TEST DATA MUST EXIST IN THE DATABASE AT THE TIME OF
    PRESENTATION.




                                                                    25
           WEB APPLICATION’S
              DATABASE
• THE Registered_Customer TABLE HAS THE FIELDS:
   –   CUSTOMER ID
   –   FIRST NAME
   –   LAST NAME
   –   LOGIN CHOSEN
   –   PASSWORD CHOSEN




                                                  26
   PROJECT PRESENTATION
• PRESENTATION DATE: AUGUST 10 IN PERSON IN CLASS.




                                                     27
                  SUBMISSION
• SUBMIT YOUR FILES AS GENERATED BY NETBEANS IN
  FOLDER “PROJECT” ON BLACKBOARD .
• NO GRADE WILL NE ISSUED UNLESS YOUR FILES ARE
  SUBMITTED ON BLACKBOARD.
• ALL PERTINENT FOLDERS GENERATED BY NETBEANS
  SHOULD BE INCLUDED:
   –   APPLCATIONCLIENT FOLDER
   –   EJB FILES
   –   WAR FILES
   –   NBPROJECT FILES
   –   SRC FILES
   –   BUILD FILES
   –   ETC.


                                                  28

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:34
posted:4/6/2012
language:
pages:28