Assignment 4

EJB

Due Date: Thursday, December 1, 2005, at 11:59 pm

For this assignment, you are to create two Enterprise Java Beans. One that is a stateless session bean and the other that is a stateful session bean.

The stateless session bean is to contain a method that computes the wind chill value. It takes two floating point numbers as parameters and return a floating point number. The two parameter values are to be tempurature and wind velocity. the return value is the calculated wind chill. The formula for wind chill is:

    W = 35.74 + 0.6215T - 35.75(V0.16) + 0.4275T(V0.16) 

     Where: W = Wind Chill Tempurature in °F
            T = Tempurature in °F
            V = Wind Velocity in MPH

     Note: if Tempurature >= 50°F or Wind Velocity <= 3 MPH, 
               Wind Chill equals Tempurature

           if Tempurature <= -50°F or Wind Velocity >= 110 MPH,
               Wind Chill is not defined

The stateful session bean is to calculate the intervals that will be used for calcuating the wind chill. The input supplied to this bean will be a low value, a high value and a number of intervals. The returned information will be the actual values for each interval.

For example, if the low value was 10, the high value was 35 and the number of intervals was six, the returned intervals would be 10, 15, 20, 25, 30 and 35. The difference between consectutive interval values is (high_value - low_value)/(number_of_intervals - 1).

These values can be set by multiple method calls (i.e. one for setting the low value, one for setting the high value, one for setting the number of intervals). The interval values can be returned in multiple method calls. For example you could have method that returns the ith interval value. This method would need to be called multiple times, one for each interval value.

The client program is to use these beans to create a wind chill table. One axis is to be tempurature values while the other axis is to be wind velocity and the body of the table will be the wind chill at the given tempurature and wind velocity. The client program is to prompt the user for the range and number of intervals for both the tempurature and the wind velocity values to be displayed in the table. Since the client program will need to maintain two interval ranges (one for tempurature and one for wind velocity), you will need to create two instances of the stateful session bean. One instance for the tempurature intervals and the second instance for the wind velocity intervals.

Your client program can be an application client, a JSP page or a Java Servlet. You can get 10 points extra credit for creating a second client program using a different technique from your first client program (i.e. if the first is an application client, your second could be either a JSP page or a Java Servlet).

For an example of a wind chill table check out http://www.weatherimages.org/data/windchill.html. This page also contains a discussion about wind chill and wind chill calculator.

You may work on this project individually or in a group of two people. If you are working in a group, only submit one copy of the project but make sure you clearly identify all members of the group. A group size of three people may be allowed only if Prof. Troy agrees (proceeded by a large amount of pleading by all members of the group in which justification is given as to why you should be allowed to have three members in the group).

Your program is to be submitted electronically via the turnin command on the LINUX machines. The project name for this is mp4. You are to submit all source code files and all .jar, .war or .ear files needed to deploy your program. All programs are expected to be written in good programming style using the java programming language.

How to turn in your work

Turnin your program electronically using the "turnin" command from your CS account as follows:

turnin -c cs441 -p mp4  [your project directory]
where the [your project directory] is the directory name under which you have all your files related to this programming problem. The turnin command will automatically compress the data under your directory, so there is no need to do the compression by yourself.

Notice you can only invoke turnin command on the Linux machines in the lab or after logging into the server machine oscar.cs.uic.edu.


If you want to verify that your project was turned in, look in the turnin directory for a file with your userid. For instance for this project, from your CS account you would type:
  

    turnin -c cs441 -p mp4 -v

Note that you can execute turnin as many times as you would like, up until the program deadline when turnin will be disabled for this project. Each time you execute turnin for a project, you overwrite all of what you had turned in previously for that project.It does not work in an incremental way.