Coding Challenge 1 - PetPals
Coding Challenge 1 - PetPals
Instructions
• Project submissions should be done through the partcipants’ Github repository, and the link
should be shared with trainers and Hexavarsity.
• Each section builds upon the previous one, and by the end, you will have a comprehensive
application implemented with a strong focus on SQL, control flow statements, loops, arrays,
collections, exception handling, database interaction.
• Follow object-oriented principles throughout the project. Use classes and objects to model real
world entities, encapsulate data and behavior, and ensure code reusability.
• Throw user defined exceptions from corresponding methods and handled.
• The following Directory structure is to be followed in the application.
o entity/model
▪ Create entity classes in this package. All entity class should not have any
business logic.
o dao
▪ Create Service Provider Interface/Abstract Class to showcase functionalities.
▪ Create the implementation class for the above Interface/Abstract Class with db
interaction.
o exception
▪ Create user defined exceptions in this package and handle exceptions whenever
needed.
o util
▪ Create a DBPropertyUtil class with a static function which takes property file
name as parameter and returns connection string.
▪ Create a DBConnUtil class which holds static method which takes connection
string as parameter file and returns connection object (Use method defined in
DBPropertyUtil class to get the connection String).
o Main
▪ Create a class MainModule and demonstrate the functionalities in a menu
driven application.
Problem Statement:
PetPals, The Pet Adoption Platform scenario is a software system designed to facilitate the adoption of
pets, such as dogs and cats, from shelters or rescue organizations. This platform serves as a digital
marketplace where potential adopters can browse and select pets, shelters can list available pets, and
donors can contribute to support animal welfare.
Implement OOPs
Create SQL Schema from the pet and user class, use the class attributes for table column names.
1.Create and implement the mentioned class and the structure in your application.
Pet Class:
Attributes:
3.PetShelter Class:
Attributes:
• availablePets (List of Pet): A list to store available pets for adoption.
Methods:
• AddPet(Pet pet): Adds a pet to the list of available pets.
• RemovePet(Pet pet): Removes a pet from the list of available pets.
• ListAvailablePets(): Lists all available pets in the shelter.
6.Exceptions handling
Create and implement the following exceptions in your application.