MAD icon indicating copy to clipboard operation
MAD copied to clipboard

Rework database wrapper

Open DrMurx opened this issue 4 years ago • 6 comments

The current database access is a historically grown monster structure. It lacks separation of concerns, is a mix of data provider, mapper/converter and other parts of the business logic that don't belong here.

Dropping monocle support opened the door for some refactoring. This would include the following steps:

  • Merge dbWrapperBase and rmWrapper into a single, humongous DbWrapper to ease up the further steps.
  • Break DbWrapper into smaller "data providers" for the different parts of the application (MITM, Route planning, Webhook, Map/Madmin).
  • Extract high-level services, business logic and data converters from the data providers so they remain a low level data access layer.
  • Group data access layer per table (as preparation for some kind of ORM in the future).

This is a meta issue to track and discuss the progress.

DrMurx avatar Nov 12 '19 13:11 DrMurx

Related/affected: #539

sn0opy avatar Nov 12 '19 13:11 sn0opy

Related/affected: #539

Related, but luckily almost not affected. The API for the MAD config already uses some kind of dedicated unified data provider.

DrMurx avatar Nov 12 '19 14:11 DrMurx

These changes have been merged into #539, f620b6c

Expl0dingBanana avatar Dec 05 '19 13:12 Expl0dingBanana

@Expl0dingBanana Only the first patch ;) more to come.

DrMurx avatar Dec 05 '19 13:12 DrMurx

@DrMurx Do you still need this enhancement open?

Expl0dingBanana avatar May 25 '20 00:05 Expl0dingBanana

@Expl0dingBanana Absolutely. I'll go forward with that as soon as my spare time allows.

DrMurx avatar May 26 '20 00:05 DrMurx