File Server App Architecture - PLLUG/CPPQT-2019-1-FileServer GitHub Wiki

Full clas diagram

Edit: http://yuml.me/edit/e58d3923

Configuration

Classes for reading configuration

Edit: http://yuml.me/edit/32d8cc4e

Base abstract class for reading server configuration is ConfigurationReader. This class should have a method that takes Configuration object as a parameter and initializes it with configuration data. Two classes are inherited ConfigurationReader: ConfigurationFileReader that reads data from the config file and CommandLineReader that reads configuration from supplied command line parameters.

Work with configuration

Edit: http://yuml.me/edit/9446f68c

All classes that will require access to configuration data will inherit Configurable class. That class abstract class will take Configuration instance as a constructor parameter.

FileSystem

Classes to work with file system

Edit: http://yuml.me/edit/c6aa1c08

FileSystemModel class will implement all work with the file system and will inherit DataModel class that will provide an abstract interface for reading data. FileSystemModel class will also inherit Configurable class to be able to read configuration data.

Generating HTML

Classes to generate HTML content

Edit: http://yuml.me/edit/55dab632

Abstract DataView class represents objects that are able to work with DataModel instances. Generator class inherits it and extends its interface with methods for generating content based on data given by DataModel and query taken as a parameter. HTMLContentGenerator inherits Generator and implements all content generation logic. HTMLContentGenerator also inherits Configurable class to be able to read configuration data.

Web Server

Web server classes

Edit: http://yuml.me/edit/77a65db1

FileWebServer class implements server logic: takes requests from clients and sends responses using data given by HTMLContentGenerator instance. FileWebServer also inherits Configurable class to be able to read configuration data.