edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
715 stars 107 forks source link

Implementing LauncherOption enum and supporting classes #196

Closed IainDavis closed 3 years ago

IainDavis commented 3 years ago

Problem Statement

Current implementation of configurable options is ad-hoc and based on Strings.

Proposed fix

Centralize and standardize the set of configurable options for the Launcher program in an enumerated type with responibility for:

Steps taken

  1. Introduced several new packages to organize functionality
  2. Introduced the described enum class
  3. Introduced supporting enums GenericPathLabel and OS that together have responsibility for resolving the ALLUSERS and USERLIB sentinels
  4. Introduced a Resolver interface, which extends UnaryOperator<String> along with some default implementations
  5. Introduced a Validator interface which extends Predicate<String> along with some default implementations

Additional steps taken that are not necessarily relevant to the current work but will affect later-planned work.

  1. Added enum LifecyclePhase that acts as a very simple state machine and implements an Observable pattern
  2. Added a LifecycleListener interface that Observers of LifecyclePhase must implement
  3. Added application-specific Exception types