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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Instructions

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

Read the following scenario:

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.

The first step will be to write the main functionality, which is essentially a Microblogging System where all the posts are automatically annotated with voice, video or text.

As an initial step, you must create the skeleton of the model for the core Microblogging System under these assumptions:

  • Activity logs recorded only by one user.

  • Each log is dated with a timestamp that is used as the key for displaying it in the feed

  • Each log should have a name, a description and a date.

  • Each log has attached the actual content, which can be plain text, an image, an audio file or a video file

  • The audio and video files are supported in multiple formats as they are recorded in through the browser and uploaded to the server using WebRTC API.

  • The images are also supported in multiple formats.

Task

Main class

  • Write a Main class that you will use as the simulator for testing you Classes

Abstraction (Classes, Objects and Interfaces)

  • Write the class log that will be used as a base for the modeling. The class log is an abstraction of what logs can do: create, read, update, and delete. Logs also include specific characteristics like name, description and date. They also include, by default, a unique internal ID and a unique short code (in the form abc-abc-abc) is assigned.

  • Implement some mockup output for the methods create, read, update, delete.

  • Instances of the class log should be created assigning one, some or none of the attributes. Write constructors.

Encapsulation (Classes, Objects and Interfaces)

  • The properties should only be accessible through member methods. Write methods for accessing the data.

Inheritance (Extends)

  • As there may be different types of logs and every one of them have their own characteristics, extend the class log as TextLog, PhotoLog, AudioLog and VideoLog and assign some validation for the content such as size and type that corresponds to the log type and triggers an error if the size limit is reached or if an invalid type is submitted when these values are set.

Polymorphism (Extends)

  • Text, Image and Video and Audio may have different formats. Override the method for validation accordingly.

  • When saving the attachment, a special action like transcoding, automatic translation, automatic close captioning etc… can be triggered. Text for example can only be translated. Images can be annotated. Video and Audio can be transcoded and close-captioned. Implement in the super class the support for those actions and extend the derivate classes for supporting one of them.

Composition (HAS_A)

  • Generalize the implementation of the actions using an Interface and concrete classes per feature, which should be incorporated into the sub classes in a composition.

Main class provided:

package com.algonquin.loggy;

public class Main {

    public static void main(String[] args) {
        Log log = null;

        // This should throw an exception as PNG is not a type handled by Text.
        log = new TextLog("first log", "Monday May 4, I had to wake up early");
        try {
            log.attachFile("image.png", "PNG", "******", Long.valueOf(1024));
        } catch (Exception e) {
            e.printStackTrace();
        }
        log.create();
        System.out.println("New log (" + log.toString() + ")\n");

        log = new ImageLog("second log", "Few minutes later, I had my first cup of coffee");
        try {
            log.attachFile("coffee.png", "PNG", "******", Long.valueOf(1024));
        } catch (Exception e) {
            e.printStackTrace();
        }
        log.create();
        System.out.println("New log (" + log.toString() + ")\n");

        log = new VideoLog("third log", "Few minutes later, I am going for a bike ride");
        try {
            log.attachFile("biking1.mp4", "MP4", "******", Long.valueOf(1024));
        } catch (Exception e) {
            e.printStackTrace();
        }
        log.create();
        System.out.println("New log (" + log.toString() + ")\n");
    }
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Module hierarchy chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY