1. A simple internet forum allows users to log in, to start threads, to post rep
ID: 3694372 • Letter: 1
Question
1. A simple internet forum allows users to log in, to start threads, to post replies in existing threads, to view a thread and all its replies, to view a list of all threads, and to search all of the posts that have been made. (a) If you created such a forum using an MVC framework, name the two models that, even from this short description, you can infer would be needed. [2 marks] (b) Explain how, if you created such a forum using an MVC framework, the “view a thread and all its replies” controller action would use the relevant model and view. Make sure you discuss what the model, the view and the controller would do in your answer. [6 marks] (c) Which of the activities described above would, if you follow best practice, require you to use the HTTP POST method, and which the HTTP GET method when passing data to the various server-side scripts? [6 marks] (d) The forum uses sessions to track logged in users. Discuss how a session cookie is set in the user’s browser, sent to the webserver, or used by the server-side script at each of these stages of the login process: (i) The user visits the login page (for the first time) [2 marks] (ii) The user submits their (valid) login details to the server [2 marks] (iii) The (now logged in) user starts a new forum thread [2 marks] (e) You decide to enrich the forum’s ability “search all of the posts that have been made” using AJAX to have the search box autocomplete. Explain briefly how the AJAX request would be triggered, what data it would submit to the server, what sort of response the server would give, and what the client-side script would do with this response. (a) Three approaches to adapting web content for display on different devices are shown below. For each approach, describe what it means and give an example of how it might be implemented. (i) Client-side. [6 marks] (ii) in-network [6 marks] (iii) Server-side [6 marks] (b) Describe, with examples, the aspects of a web page which might need to be altered using the above approaches to optimise the page for different devices. [7 marks]
Explanation / Answer
Answer:
In general a project is build based on any protocol or system or framework one of the such methods is MVC architecture.MVC indicates Model View Controller in which the project is build based on the modules which are available.It is one of the highly used architectures in industry and mostly now automated these days by the automation tools.In brief the View consists of presentation logic i.e UI which the user will see and it can be written in any technology which is html,html5,xml,jsp etc.View section consists of different form elements and buttons where user can perform CURD operations i.e Create,Update,Retrieve and Delete operations in the application.Next comes model which involves the business logic of the application which indicates the heart of the code for application.It can be security code or calculation of any operations will be performed over the model.The model can be build in any of the technology such as java,.net,ruby etc based on the requirement provided.The model can also be structured as modules which are given to developers to perform the function seperately and later on to integrate as one so that it works.The data which is present as object,data members and class are with hold in the business logic of the application.The model contains the essential data which is required for the operations need to be performed in the requirement document given for the project.The last section of MVC architecture is Controller which has the flow control logic.It consists of the code to move the pages from one to other by the user based on the operation in the view is implemented.In genral the code can be written in java,.net,ruby etc based on the requirement for the application.The flow control logic is known as the place where the implementation of code for switching from one page to other is written in a user friendly language which can be java,.net,php,ruby etc.This can also be implemented as modules based on the user requirement by the developer for the set of prerequiste conditions.MVC frameworks is available in update for some technologies where the diiferent plugins of that particular technologies are relesed and there by the implementaion in project makes it as updated version of code.Inside the MVC architecture the data is sent by POST and GET methods.The GET method is used when we want to transfer small amount of data i.e limited amount of data and the data is passed as parameters by using some delimiter values on the url it is diplayed if the method used is GET.It is also not secure to use GET method for some cases not all.In the JSON document for the webservices such as REST the input parameters are passed as parameters using GET method to get the response.In POST method the data is secured and also the parameters are not displayed on the url while submisiion of forms.The use of POST method is secure and we can send any amount data i.e unlimited amount of data using POST method without any constraints.Most of the applications use POST method as it is more secure and robust.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.