SlideShare a Scribd company logo
1 of 10
Animal Project
AHMED ALI
STUDENT ID: 15037511
MODULE TITLE & CODE: CS5003 - Data Structures and Specialist Programming
COURSEWORK NUMBER 2
1
Overview
This application is a simple web-technology site using MySQL and JSF to manage the animals in the zoo.
The functionalities include inserting, updating, deleting, listing, and searching. It also takes advantage of
Ajax handling and file uploading to increase user interaction experience. So we simply call it ‘The Zoo’.
Site map
User interface principles
The application is simple, so as the principle: Reusability and Structural
1. Reusability
The application uses the same grid to display the result for both the listing and searching
functionalities.
The application takes advantage of Ajax to provide the result immediately on request.
2. Structural
The application allows image uploading. Moreover, it uses a separate folder to store the
images uploaded, outside of the folder containing the application. This is to avoid
accidentally deleting them when redeploying.
Database
1. Tables
The application is simple with only one table.
Animals (animal_name, animal_image, imported_in)
2
Animals
animal_name varchar(32)
animal_image varchar(64)
imported_in date
3. Classes
DBConnectionHelper class
The class DBConnectionHelper is a utility class to help create the connection to database and
close connection when it is not needed anymore.
Animal class
The class Animal is a bean class to help create or update an animal object.
When creating a new animal, the animal’s image will be uploaded to the image property of
the class and will be copied to the specified folder configured on web.xml. To avoid file
name collision, the method will generate a unique name, using UUID class.
When updating an animal object, the class will update the object’s ‘mode’ to editable. This
will ease the process of updating the record on the animal object grid.
Besides the methods listed above, the class also contains getter and setter methods for name,
image Url and year imported properties.
YearImportedConverter class
3
The class YearImportedConverter is a converter class to help convert the string value of year
imported field to a Date object, and vice versa. This is due to the application to expect a
number representing the year when the animal has been imported, but the value is saved as a
date column in the database.
ZooController class
The class ZooController class is the main class to handle business of the application: insert,
update, delete, list, and search. So it contains several fields to support each function.
Insert
The controller class uses Ajax to handle animal image uploading via uploadImage() method.
It also contains an Animal object to store the information for the being-created animal.
After creating the animal successful,the application navigates to the list page, so user can see
the new record in the grid.
List
The controller class displays the animals in a grid, the same way as search page. Each row
has separate buttons to delete and edit the animal in-line. Clicking on the Edit button will
make the animal in the row editable.
Update
When the animal is in editable mode, the user can choose to save the new information added.
Delete
4
The application allows to delete the animal using Ajax by sending the animal name attached
to the Delete button which has been clicked. The controller will identify the animal by name
and delete it in the database,together with delete it from the animal collection displayed in
the grid.
Search
The search functionality is in the same page with listing. So the controller contains a search
text to bind the value to search via Ajax.
Static contents
The application stores the icons used in a separate folder named img. Both the css file and
img folder reside in the resources folder.
5
Testing
Index page
Insert page
6
Upload file when inserting
After inserting a kangaroo record
Search via Ajax
7
After deleting the bear
Edit the tiger
8
After saving changes
9
Conclusion
For this coursework, I have demonstrated how MYSQL can be effectively used to store and display data
directly from and to my web application. To take things further when making my web app I used pictures
to accommodate each animal.
The most difficult thing that I was faced with was to create an object that allows one to perform CRUD
operations a short hand for simple INESRT,SELECT, UPDATE,and DELETE queries on a single table
on the specified connection pool and table. In conclusion making web app can never be easy as a lot of
things must be considered such as how the information will be stored, what features if any will you go for
in terms of making your app more appealing for the users.

More Related Content

Similar to Animal Project

Android Database Tutorial
Android Database TutorialAndroid Database Tutorial
Android Database TutorialPerfect APK
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2Kalluri Vinay Reddy
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
adjava_23_bcs_vision_academy_sachinsir.pdf
adjava_23_bcs_vision_academy_sachinsir.pdfadjava_23_bcs_vision_academy_sachinsir.pdf
adjava_23_bcs_vision_academy_sachinsir.pdfakankshasorate1
 
project2.classpathproject2.project project2 .docx
project2.classpathproject2.project  project2 .docxproject2.classpathproject2.project  project2 .docx
project2.classpathproject2.project project2 .docxbriancrawford30935
 
JQUERY TUTORIALS
JQUERY TUTORIALSJQUERY TUTORIALS
JQUERY TUTORIALSMoize Roxas
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comMohamed Rimzan
 
Taking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and BeyondTaking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and BeyondSalesforce Developers
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxGevitaChinnaiah
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android ApplicationMark Lester Navarro
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask TutorialPerfect APK
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2Isham Rashik
 

Similar to Animal Project (20)

Lab2-android
Lab2-androidLab2-android
Lab2-android
 
Hello Android
Hello AndroidHello Android
Hello Android
 
Android Database Tutorial
Android Database TutorialAndroid Database Tutorial
Android Database Tutorial
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
adjava_23_bcs_vision_academy_sachinsir.pdf
adjava_23_bcs_vision_academy_sachinsir.pdfadjava_23_bcs_vision_academy_sachinsir.pdf
adjava_23_bcs_vision_academy_sachinsir.pdf
 
2 oop
2 oop2 oop
2 oop
 
project2.classpathproject2.project project2 .docx
project2.classpathproject2.project  project2 .docxproject2.classpathproject2.project  project2 .docx
project2.classpathproject2.project project2 .docx
 
Lab3-Android
Lab3-AndroidLab3-Android
Lab3-Android
 
JQUERY TUTORIALS
JQUERY TUTORIALSJQUERY TUTORIALS
JQUERY TUTORIALS
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.com
 
Taking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and BeyondTaking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and Beyond
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptx
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android Application
 
Synopsis
SynopsisSynopsis
Synopsis
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
 
iOS Development (Part 2)
iOS Development (Part 2)iOS Development (Part 2)
iOS Development (Part 2)
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
 

Recently uploaded

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 

Recently uploaded (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Animal Project

  • 1. Animal Project AHMED ALI STUDENT ID: 15037511 MODULE TITLE & CODE: CS5003 - Data Structures and Specialist Programming COURSEWORK NUMBER 2
  • 2. 1 Overview This application is a simple web-technology site using MySQL and JSF to manage the animals in the zoo. The functionalities include inserting, updating, deleting, listing, and searching. It also takes advantage of Ajax handling and file uploading to increase user interaction experience. So we simply call it ‘The Zoo’. Site map User interface principles The application is simple, so as the principle: Reusability and Structural 1. Reusability The application uses the same grid to display the result for both the listing and searching functionalities. The application takes advantage of Ajax to provide the result immediately on request. 2. Structural The application allows image uploading. Moreover, it uses a separate folder to store the images uploaded, outside of the folder containing the application. This is to avoid accidentally deleting them when redeploying. Database 1. Tables The application is simple with only one table. Animals (animal_name, animal_image, imported_in)
  • 3. 2 Animals animal_name varchar(32) animal_image varchar(64) imported_in date 3. Classes DBConnectionHelper class The class DBConnectionHelper is a utility class to help create the connection to database and close connection when it is not needed anymore. Animal class The class Animal is a bean class to help create or update an animal object. When creating a new animal, the animal’s image will be uploaded to the image property of the class and will be copied to the specified folder configured on web.xml. To avoid file name collision, the method will generate a unique name, using UUID class. When updating an animal object, the class will update the object’s ‘mode’ to editable. This will ease the process of updating the record on the animal object grid. Besides the methods listed above, the class also contains getter and setter methods for name, image Url and year imported properties. YearImportedConverter class
  • 4. 3 The class YearImportedConverter is a converter class to help convert the string value of year imported field to a Date object, and vice versa. This is due to the application to expect a number representing the year when the animal has been imported, but the value is saved as a date column in the database. ZooController class The class ZooController class is the main class to handle business of the application: insert, update, delete, list, and search. So it contains several fields to support each function. Insert The controller class uses Ajax to handle animal image uploading via uploadImage() method. It also contains an Animal object to store the information for the being-created animal. After creating the animal successful,the application navigates to the list page, so user can see the new record in the grid. List The controller class displays the animals in a grid, the same way as search page. Each row has separate buttons to delete and edit the animal in-line. Clicking on the Edit button will make the animal in the row editable. Update When the animal is in editable mode, the user can choose to save the new information added. Delete
  • 5. 4 The application allows to delete the animal using Ajax by sending the animal name attached to the Delete button which has been clicked. The controller will identify the animal by name and delete it in the database,together with delete it from the animal collection displayed in the grid. Search The search functionality is in the same page with listing. So the controller contains a search text to bind the value to search via Ajax. Static contents The application stores the icons used in a separate folder named img. Both the css file and img folder reside in the resources folder.
  • 7. 6 Upload file when inserting After inserting a kangaroo record Search via Ajax
  • 8. 7 After deleting the bear Edit the tiger
  • 10. 9 Conclusion For this coursework, I have demonstrated how MYSQL can be effectively used to store and display data directly from and to my web application. To take things further when making my web app I used pictures to accommodate each animal. The most difficult thing that I was faced with was to create an object that allows one to perform CRUD operations a short hand for simple INESRT,SELECT, UPDATE,and DELETE queries on a single table on the specified connection pool and table. In conclusion making web app can never be easy as a lot of things must be considered such as how the information will be stored, what features if any will you go for in terms of making your app more appealing for the users.