Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
48 views

Assignment - Java Developer Intern

Uploaded by

Poorvi Gupta
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)
48 views

Assignment - Java Developer Intern

Uploaded by

Poorvi Gupta
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
You are on page 1/ 2

Assignment: CRUD Operations for Project Management System

Objective: Develop a RESTful API using Java 17 and Spring Boot, implementing CRUD (Create,
Read, Update, Delete) operations for a Project Management System. The system should use an
in-memory database for data storage and management.

Prerequisites:

• Proficiency in Java 17

• Familiarity with Spring Boot framework

• Understanding of RESTful API principles

• Basic knowledge of in-memory databases

Task Overview: You are required to design and implement a simple Project Management System
where users can create, retrieve, update, and delete project information. The application should
be built using Java 17 and Spring Boot, with an in-memory database like H2 for data persistence.

Detailed Steps:

1. Project Setup: • Initialize a new Spring Boot project using Spring Initializr
(https://start.spring.io/). • Include dependencies: Spring Web, Spring Data JPA, H2 Database. • Set
up the project structure with appropriate packages (controllers, services, repositories, models,
etc.).

2. Database Configuration: • Configure the H2 in-memory database in application.properties. •


Define the schema for the 'Project' entity (attributes: id, name, description, startDate, endDate,
etc.).

3. Model Creation: • Create a Project model class in the models package with annotations for JPA
entity.

4. Repository Layer: • Create a ProjectRepository interface extending JpaRepository to handle


data operations.

5. Service Layer: • Implement a ProjectService class to handle business logic. • Define methods for
create, read, update, and delete operations.

6. Controller Layer: • Develop a ProjectController class to handle HTTP requests. • Map CRUD
operations to RESTful endpoints (e.g., POST /projects, GET /projects/{id}, etc.).

7. CRUD Operations: • Create: Implement an endpoint to add a new project. • Read: Implement
endpoints to retrieve all projects and a single project by ID. • Update: Implement an endpoint to
update an existing project. • Delete: Implement an endpoint to delete a project by ID.

8. Exception Handling: • Implement global exception handling using @ControllerAdvice to


manage exceptions and provide meaningful error messages.

9. Data Validation: • Use Spring Validation to validate input data for create and update
operations.

10. Testing: • Write unit tests for service layer methods. • Write integration tests for API
endpoints.

11. Documentation: • Document each API endpoint using Swagger or a similar tool.
12. Submission: • Provide a GitHub repository link containing the complete project. • Include a
README file with setup instructions and API usage details.

For internal: Evaluation Criteria: Code Quality: Clean, readable, and well-organized code.
Functionality: All CRUD operations work as expected. Error Handling: Appropriate handling and
reporting of errors. Testing: Coverage of key functionalities with tests. Documentation: Clear and
comprehensive documentation of the API.

You might also like