Skip to content
This repository was archived by the owner on Feb 12, 2023. It is now read-only.

DevExzh/AppStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment 2

License JUnit XStream ZHU He SETU GitHub

A simple implementation of assignment of Programming Fundamentals in Practice, just for being evaluated for marks so feel free to copy the code 😆

The program may still have some 🐛 bugs. If you find them, please let me know (via e-mail).


Overview

Its main ambition is to develop an App Store system. It is a menu-driven, console app that can store apps of the following type:

  • EducationApp
  • GameApp
  • ProductivityApp

An app can only be added for existing developers. The information entered via the app will be persisted in XML files.

Tests

Class Name Code Coverage Test Results
AppStoreAPI
EducationApp
GameApp
ProductivityApp

Classes

  • Newly added

    Class Name Responsibility
    FoundationClassUtility Extend the functionality of utils package, providing more convenient tools like function pointers, statistics, etc.
    Language Enumerate all the languages that are available on the App Store.
    Genre Enumerate the genres that a GameApp belongs to.

    Function pointers are provided in the package, you can use them in this way:

    // Declaring a function using FunctionPointer class void function(FunctionPointer<Void, Integer> callback) { callback.invoke(1234); // Call the method } // Employing lambda (Since Java 8) function((Integer parameter) -> parameter + 20)
  • Modified

    Class Name Modification
    DeveloperAPI, AppStoreAPI Since the XStream.setupDefaultSecurity() method is deprecated in version 1.4.18 and above, the implementation of the load() method is modified to avoid using the deprecated method.
    DeveloperAPI, AppStoreAPI Because FileNotFoundException will be thrown if the two XML files do not exist in the specified path, the fileName() method has now been modified to create the file if it does not exist.
  • Additional fields

    Class Name Extra fields Description
    App String description Describe the functionality, target age groups, etc. of an app with brief information.
    App HashSet<Language> languages Indicate the languages that an app support.
    App String currencySymbol The current currency symbol employed in the App Store system (CNY/EUR/USD/GBP).
    GameApp HashSet<Genre> genres Types or styles of a GameApp.

Extra functionality

There are several additional functionalities I have written in class main.Driver:

  • Add a private field clearScreen which is a function pointer that will be instantiated when the start() method is called. On Windows platform, it will clear the console by using command cls and on macOS or other UNIX-like OS it will do the same operation by print special characters to the console (Not tested).

    Use the following statement when you want to clear all outputs on the console:

    clearScreen.invoke();
  • Platform Specified Feature: When the program run on Windows, the window title will be changed into App Store

License

Apache 2.0 © Ryker Zhu (ZHU He)

About

A simple implementation of assignment of Programming Fundamentals in Practice

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages