KeePassDX icon indicating copy to clipboard operation
KeePassDX copied to clipboard

Extract database module

Open GianpaMX opened this issue 2 years ago • 0 comments

Resolves #1370 by extracting the database code into a separate gradle module

                       ┌─────┐
                       │ app │
                       └──┬──┘
                          │
        ┌─────────────────┼──────────────────────────┐
        │                 │                          │
        ▼                 ▼                          ▼
  ┌──────────┐   ┌───────────────────┐   ┌────────────────────┐
  │ database │   │ icon-pack-classic │   │ icon-pack-material │
  └─────┬────┘   └───────────────────┘   └────────────────────┘
        │
        ▼
   ┌────────┐
   │ crypto │
   └────────┘

There few tricks I had to do to extract the code: IconPackChooser. I had to extract an interface (InterfaceIconPackChooser open to a better name suggestion) so the database module can depend on the interface but not on the implementation that requires values from the app BuildConfig

Exceptions. Instead of passing a string id, I just identified the exception class and linked it manually

Templates. Default name, fields and title are passed as strings instead of res ids

In a different PR

  • publish crypto module in maven repo
  • publish database module in maven repo

KeePassDX development can continue with the proposed structure and it should be familiar to any other developer

GianpaMX avatar Jul 28 '22 16:07 GianpaMX