7COM1081 SDE: Sprint Cycle Documentation for Animals R Us Project

Verified

Added on  2022/09/07

|2
|548
|31
Report
AI Summary
This document details the sprint cycle documentation for the Animals R Us & Veterinary School System, developed as part of a software development exercise (7COM1081). The project utilizes a PHP-based framework with a .htaccess file for URL management and a configuration file to set the base URL and autoload libraries. The development process followed specific naming conventions for models and controllers, with separate view files for each entity. The Animals controller was created first, with methods for displaying animal lists and setting the default controller. A database model was implemented to manage animal data, including methods for retrieving, creating, and assigning owners. The owner assignment process was designed to update records instead of inserting new ones, and a composite primary key was used to assign vets for lessons. The document covers the project's structure, model creation, controller design, database implementation, and website structure.
Document Page
We have used a .htaccess file in the root folder so that we can write the url without
worrying about using index.php. In the config file we have set $config['index_page'] to empty
string. Then we have set the base url as http://127.0.0.1:8080/Website/. In the autoload php we
have set $autoload['libraries'] as array('form_validation', 'database', 'session');. For helper
function we have set $autoload['helper'] = array('url', 'form');. After configuration is done we
started working on the project itself.
We have used some basic rules to maintain the naming conventions and application
structure. Each model has _model as the postfix. This ensures that we can easily search and
identify the models. As every controller and models are class, we uses first letter as class for
these files. It is a conventional rules to use class name’s first letter as capital. In order to match
the class name with file name we have done that. Views for each entity is stored within separate
files. Controller names are in plural as well as folder directories within the views directory. To
maintain easily maintainable code, we had used templates for header and footer. We have just
extracted the header and footer of the website and store those in separate files under templates
folder.
We created the Animals controller first and create index method to show all the animal
list in the index php under animals directory within view. Now that we had out controller, we
had set the default_controller in the routes page as animals/index. This ensured that whenever we
enter website the first page that opens is animals page. After that we had created the model for
animals entity in database. Then in the model we created get_animals, create_animal,
assign_owner and count methods. Same approach has been applied for each of the elements in
the site for registering and indexing of data rows.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
After owner registration process is implemented, we have focused on assigning animal to
an owner. We understood for each animal there was two options, either an owner is assigned or
not. If not assigned then website will show assign button or it will show owner name and
reassign button. We had decided that we will use same function to update and assign the owner.
That is why we changed the owner_id foreign key to be nullable and set to default value to 0. So
instead of inserting data at first attempt we used update every time a new request can be
controller for assign method.
For assigning vets for lessons, it was essential to choose the animal on which vet will
practice. That is why both the vet and animal was set as composite primary key in the pivot table
along with lesson id. The assign vet form has been designed such way that it only shows the
animals that matches the condition mentioned in the lesson.
chevron_up_icon
1 out of 2
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]