Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment6: Other Patterns - Lab (4%)This assignmentrelates to the following Course Learning Requirements:CLR 1 -Implement an objected-oriented program design incorporating the use of bestpractice...

1 answer below »

Assignment
6: Other Patterns - Lab (4%)



This assignment
relates to the following Course Learning Requirements:



CLR 1 -
Implement an objected-oriented program design incorporating the use of best
practice design patterns using the JAVA programming language.



CLR 3 – Develop
an application thru the use of refactoring steps which culminate in the
demonstration of the Model-View- Controller or modified Model-View-Controller
design pattern.



CLR 4 – Develop
web applications using Java.





Objective of this
Assignment:



The objective of
this assignment is to demonstrate the skills required to:




  1. Design a web-based Java
    application using both sever-side and client-side programming.



Instructions



To prepare you
for this assignment, read the module 11 and 12 content and follow the embedded
learning activities.





Tasks:




  1. The first task of this assignment is to
    read the scenario below. It is a continuation from the previous
    assignment.










Code&CodeScenario


Code&Code is
a small company dedicated to Software Development. Their engineering team, to
which you belong, is working on writing a Web Application as an MVP for a new
customer.


The code name
for this App is “Loggy”, which is meant to offer functionality for a personal
journal where users can log their daily activities through text, voice and
video.


Your team was
assigned to write the main functionality, which is essentially a
Microblogging System where all the posts can be annotated with voice, video,
images or text.


In your third
iteration you created a web application that would be the foundation for the
Microblogging System under the following assumptions:



  1. Users submit their
    logging activity through a web page to a single thread in the same way
    Twitter users submit their posts. A form containing an input box and
    submit button is shown at the top and under that, a list with all the
    previous submissions ordered by the timestamp in descending order.

  2. A short title (60chars) and a short
    description (120 chars) is required. After that, the user attaches the
    actual content, which can be a text, picture, audio or video file.

  3. The file is processed in the server
    and a thumbnail is shown right below the description.








  1. Once you have familiarized yourself with
    the scenario provided above, you must review the code from the previous
    iteration (provided) and proceed with code refactoring by applying Design
    Patterns in order to improve the general design.





MVC Pattern



The application renders HTML
directly from the Servlet. While this approach was good enough for a quick
prototype, it would not scale.






  1. Apply the MVC pattern by
    templating the View using JSP pages.

  2. Customize the CSS styling
    with a design of your choice.







Submission:



Your submissions
for this assignment should include:




  1. Java code of your final
    solution.

  2. Report of your
    observations on the changes you had to do to your code while following the
    recommended steps. Add snippets of code to the report to show intermediate
    steps.





*Remember that
although the scenario and resulting model may be used for future activities,
the main goal is to practice what you have learned in the modules 11 and 12, so
do not be worried about finding the perfect solution for this case. Going
beyond the scope of these two models is optional and will not be taken into
consideration for the grades.





Guidelines




  1. Once you have completed all steps and
    followed submission requirements, post your assignment in the designated
    attachment section in Brightspace when your facilitator assigns it. Check
    the course modules and weekly schedule for instructions.

  2. The submission consists of four separate
    files.


    1. A WAR file optimized for Tomcat 9
      thatincludes the source code, static resources and
      dependencies.

    2. A DDL file containing the Database
      description for the project (unless you have opted for adding code for
      auto-generating the database if it does not exist).

    3. A MP4 file with a screen capture
      demonstrating how your application works in at least two browsers
      including Chrome. The recording does not have to include voice over and
      should be between 1 and 2 minutes only.

    4. A DOC file containing your report.


  3. The project provided makes use of MySQL,
    you must keep it that way. The database should be named as
    lab6_STUDENTNUMBER. And if the username is hardcoded, the name used should
    be “root” with no password. Otherwise specify in the submission where the
    database name, username and password should be configured.

  4. All files should be named as
    Assignment_NUMBER_STUDENTNUMBER.extension
    (Where extension means docx, mp4, zip etc, not the word extension)



Ensure you
properly cite any work that is not yours in your submitted documents, including
code.



Code to follow:









Log.java:
package com.algonquin.loggy.beans;



import java.util.Date;



import java.util.UUID;



public abstract class Log {




private UUID id;




private String title;




private String content;




private Date createTimestamp;




public Log() {




}




public Log(String title, String content) {




this.id = UUID.randomUUID();




this.title = title;




this.content = content;




this.createTimestamp = new Date();




}




/**




* @return the id




*/




public UUID getId() {




return id;




}




/**




* @param id the id to set




*/




public void setId(UUID id) {




this.id = id;




}




/**




* @return the title




*/




public String getTitle() {




return title;




}




/**




* @param title the title to set




*/




public void setTitle(String title) {




this.title = title;




}




/**




* @return the content




*/




public String getContent() {




return content;




}




/**




* @param content the content to set




*/




public void setContent(String content) {




this.content = content;




}






/**




* @return the createTimestamp




*/




public Date getCreateTimestamp() {




return createTimestamp;




}




/**




* @param createTimestamp the createTimestamp to set




*/




public void setCreateTimestamp(Date createTimestamp) {




this.createTimestamp = createTimestamp;




}



}

Answered 5 days After Nov 22, 2022

Solution

Robert answered on Nov 28 2022
32 Votes
Tomcat and Servlets
Report
Apache Tomcat is an open-source implementation of the Java Servlet, JavaServer Pages (JSP), Java Expression Language (JSTL) and WebSocket technologies. The Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket specifications are developed under the Java Community Process (http:
tomcat.apache.org/).
Introduction
We use tomcat in conjunction with IntelliJ to run a web project. Tomcat is a delivery system for our project. Tomcat sits between the
owser and project. Every time a URL is sent to Tomcat server an associated servlet which has a matching URL will be created if it does not already exist. That servlet will handle processing of request received. Tomcat can also handle the connection pool to the DB. This connection pool can be used by other frameworks like Hibernate.
Configuration
Web projects will have a folder called “web pages” or “web content”. This name can be different depending on the IDE. It can also be changed in the settings of the project. We simply going to refer to it as “Web Folder”.
Inside of web folder there are three files to keep track of.
· Context.xml inside of META_INF folde
· Web.xml inside of WEB_INF folde
· Index.html inside of web folde
The config file can also have resources such as details of DB. These details are needed for tomcat connection pool to connect...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here