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).
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:
EducationAppGameAppProductivityApp
An app can only be added for existing developers. The information entered via the app will be persisted in XML files.
| Class Name | Code Coverage | Test Results |
|---|---|---|
AppStoreAPI | ||
EducationApp | ||
GameApp | ||
ProductivityApp |
-
Newly added
Class Name Responsibility FoundationClassUtilityExtend the functionality of utils package, providing more convenient tools like function pointers, statistics, etc. LanguageEnumerate all the languages that are available on the App Store. GenreEnumerate the genres that a GameAppbelongs 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,AppStoreAPISince the XStream.setupDefaultSecurity()method is deprecated in version 1.4.18 and above, the implementation of theload()method is modified to avoid using the deprecated method.DeveloperAPI,AppStoreAPIBecause FileNotFoundExceptionwill be thrown if the two XML files do not exist in the specified path, thefileName()method has now been modified to create the file if it does not exist. -
Additional fields
Class Name Extra fields Description AppString descriptionDescribe the functionality, target age groups, etc. of an app with brief information. AppHashSet<Language> languagesIndicate the languages that an app support. AppString currencySymbolThe current currency symbol employed in the App Store system (CNY/EUR/USD/GBP). GameAppHashSet<Genre> genresTypes or styles of a GameApp.
There are several additional functionalities I have written in class main.Driver:
-
Add a private field
clearScreenwhich is a function pointer that will be instantiated when thestart()method is called. On Windows platform, it will clear the console by using commandclsand 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
Apache 2.0 © Ryker Zhu (ZHU He)