Question: Topics and learning objectives! 1 . Reading and writing files 2 . Model - View - Controller 3 . Session variables 4 . Object -
Topics and learning objectives!
Reading and writing files
ModelViewController
Session variables
ObjectOriented Programming
Task Description
The aim of this assignment is to build upon the online store that you created in Assignment to make
it more sophisticated.
Start by copying your code from Assignment at ~publichtmlassignmentsassignment
into your new directory for Assignment at ~publichtmlassignmentsassignment
This will be your starting code for Assignment
If you didnt complete Assignment or dont have access to your code for some reason,
there will be some sample starting code available on Brightspace.
Task Description cont
Specific tasks and requirements of the assignment are listed later in this manual.
Here is a broad overview of the changes that we will be applying to our starting code:
Adding MVC patterns to the application.
We will create new files and move code around as needed to meet the MVC design patterns.
Using OOP to create classes that represent our products and categories.
These classes will be defined in the Model, and then used by the View and Controller.
Storing the product data in a csv file, instead of an array.
The Model component of the application will handle interactions with the csv file,
using the relevant class eg the Product class works with products.csv
Using session variables to store information about selected category and products.
Task Requirements
Your code should be clean, and follow good coding practises Marks
Good code will have the following qualities:
i Comments are used to explain the logic of your code.
No need to explain basic code, syntax, etc. Instead, explain why your code is written a
certain way eg what your ifstatement is checking, what your array represents, etc.
ii Variables have sensible humanreadable names eg $categories is better than $c
iii. Use indentation inside ifstatements, loops, function definitions, multiline arrays, etc.
iv Proper spacing around operators, function parameters, etc. eg
$choice $categories$i is better than $choice$categories$i
v No redundant code ie code that doesnt do anything, or is just used for testing, etc.
Any PHP file that you make should have the following code at the bottom, so that the source
code is shown on the page Mark
echo
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
