Architecture - gotonode/ohtu GitHub Wiki

This document outlines the architecture for our project.

Outline

Bookmarks Database is a Java console application used to save and list different bookmarks.

A bookmark can be of the following types (not all have been implemented yet): blogpost, video, article, book or podcast

Database in use is SQLite.

Testing will be done with JUnit, and we're also using Cucumber so that the customer can more easily review the testing processes.

Code coverage will be monitored by Codacy. Continous integration and testing will be handled by Travis.

Code style will be enforced by Checkstyle.

Classes and class dependencies

Package: main

  • Main contains the starting point for the whole program
  • App contains the actual app, responsible for running the logic loop and updating the user interface

Package: ui

  • UiController has the responsibility of handling the console-based user-interface, as well as reading input from the user via either the ConsoleIO or StubIO class

Package: tools

  • Builder will be used to construct various objects

Package: io

  • IO is an interface, implemented by the two classes below
  • ConsoleIO will be used in production, to print and read things from the actual console
  • StubIO will be used when testing the app, and doesn't rely on the console

Package: enums

  • Commands houses all the commands that the user can choose in an enum

Package: domain

  • Bookmark is an abstract class, extended by the classes below
  • Blogpost contains, in addition to what Bookmark contains, an author and an URL

Package: database

  • Database handles opening the connection to the database, and returning it to the DAO classes

Package: dao

  • ObjectDao is an interface, implemented by the classes below
  • BookmarkDao handles all bookmarks, regardless of type
  • BlogpostDao only handles objects of type Blogpost in and out of the database