Question
Context and Dependency Injection (CDI) Java code that uses CDI. The code that you createshould be based upon example 7 in chapter 2 of the
Context and Dependency Injection (CDI)
Java code that uses CDI. The code that you createshould be based upon example 7 in chapter 2 of the Beginning Java EE 7 textbook. Your new code willdefine an application that randomly assigns numbers to college courses instead of books (as in the textbook example). Download a copy of the Java2_Starter and then make the following changes to satisfy the assignment requirements. The starter code is a version of the chapter 2 example 7 application with the Maven-related instructions removed.
email me to get the Java2_starter at aaeyux at g m a i l.com
Requirements:
1.
The Book07 class must be changed into a Course class with properties dept (String), campus
(String), time (String), and number (Integer).
2.Convert the interface NumberGenerator07 to CourseGenerator.
3.Classes IsbnGenerator07 and IssnGenerator07 implement the interface. Replace these classes with three new associated classes CISGenerator, ENGGenerator and MATGenerator that implement your CourseGenerator interface. However, unlike the original generator classes, your new classes must use a random number to select a pre-defined course number from an array (Integer) filled with 10 4-digit course numbers. (I.E., Use the random number as a subscript to select one of the course numbers from the pre-defined array.)
4.Replace qualifier files EightDigits07 and ThirteeenDigits07 with CIS, ENG and MAT qualifier files. These qualifiers are used in your generator classes and servlet.
5.In your A2Servlet class, create a method createCourseNumber to take the place of method assignBookNumber. Also change the @Inject, qualifier, and private variables at the top of the servlet class to match your new qualifiers and interface.
6.Modify the servlet so that it will call the new method createCourseNumber to create CIS, ENG and MAT course numbers and display results using the out.println statements
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started