0% found this document useful (0 votes)
3 views3 pages

SpringCore Value Annotation Tasks

The document outlines four tasks for creating Spring Core applications using the @Value annotation to inject various details. Each task includes the creation of a Maven project, defining a component class with specific fields and methods, and implementing a main class to interact with the Spring container. The tasks cover an online grocery store, a movie ticket booking system, a hospital patient registration system, and a mobile recharge service system.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

SpringCore Value Annotation Tasks

The document outlines four tasks for creating Spring Core applications using the @Value annotation to inject various details. Each task includes the creation of a Maven project, defining a component class with specific fields and methods, and implementing a main class to interact with the Spring container. The tasks cover an online grocery store, a movie ticket booking system, a hospital patient registration system, and a mobile recharge service system.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Spring Core @Value Annotation - Scenario Based Tasks

Task 1 – Online Grocery Store Discount System


Project Name: GroceryDiscountApp

Objective: Create a Spring Core Maven application that uses @Value annotation to inject grocery store details and
discount information.

Requirements:
1. Create Maven Project and add Spring Core dependency in [Link].
2. Create Class: [Link]
3. Annotate class with @Component.
4. Use @Value annotation to inject all field values.

Fields:
• storeId
• storeName
• location
• discountPercentage
• homeDeliveryAvailable

Methods:
• showStoreDetails()
• calculateDiscount(double amount)

5. Create Configuration Class with @Configuration and @ComponentScan.


6. Create Main Class.
Main Class Requirements: Load Spring container, get bean from container, display store details and calculate
grocery discount.

Task 2 – Movie Ticket Booking System


Project Name: MovieTicketBookingApp

Objective: Develop a movie booking application using Spring Core where ticket pricing and theater details are
injected using @Value.

Requirements:
1. Create Maven Project and add Spring Core dependency in [Link].
2. Create Class: [Link]
3. Annotate class with @Component.
4. Use @Value annotation to inject all field values.

Fields:
• theaterName
• movieName
• ticketPrice
• availableSeats
• imaxAvailable

Methods:
• bookTickets(int seats)
• showMovieDetails()

5. Create Configuration Class with @Configuration and @ComponentScan.


6. Create Main Class.
Main Class Requirements: Book tickets, reduce available seats and display final booking information.

Task 3 – Hospital Patient Registration System


Project Name: HospitalRegistrationApp

Objective: Create a patient registration system where hospital and doctor information are injected using @Value.

Requirements:
1. Create Maven Project and add Spring Core dependency in [Link].
2. Create Class: [Link]
3. Annotate class with @Component.
4. Use @Value annotation to inject all field values.

Fields:
• hospitalId
• hospitalName
• doctorName
• consultationFee
• emergencyAvailable

Methods:
• registerPatient(String patientName)
• showHospitalInfo()
• calculateTotalBill(int days)

5. Create Configuration Class with @Configuration and @ComponentScan.


6. Create Main Class.
Main Class Requirements: Register multiple patients, display hospital information and calculate patient bill.

Task 4 – Mobile Recharge Service System


Project Name: MobileRechargeApp

Objective: Build a recharge service application using Spring Core where recharge plan details are injected using
@Value.
Requirements:
1. Create Maven Project and add Spring Core dependency in [Link].
2. Create Class: [Link]
3. Annotate class with @Component.
4. Use @Value annotation to inject all field values.

Fields:
• providerName
• planName
• validityDays
• planPrice
• dataLimitPerDay

Methods:
• showPlanDetails()
• calculateYearlyExpense()

5. Create Configuration Class with @Configuration and @ComponentScan.


6. Create Main Class.
Main Class Requirements: Display recharge plan details, calculate yearly recharge expense and show provider
information.

You might also like