USACE / USACE/cwms-data-api

Improvement to TimeSeriesRecord Usage

Open
#1,151 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

The TimeSeries class defines the tuple of data with a separate list. We do this as we have extra data that may or may not be required for a given usage such as data entry data, associated text.

Should we create a builder where you manually add column names, index, and type, and and functions in the row builder to set such?
something like

withColumn(int index, String name, String description, Class<T> type) {
"logic"
}

... Record:

<T> setColumn(int index, T value, Class<T> type) {
  "logic"
}

Or something like that, it would prevent the need in TimeSeriesDaoImpl have two different loops doing almost 90% the same work. just a check for "I have this column requested, let's also add it."

Basically instead of hard coding the columns at all (okay, maybe time... is a time series) , the user of the given TimeSeries object (after set by builder) can define them at run-time.

Originally posted by @MikeNeilson in https://github.com/USACE/cwms-data-api/pull/927#discussion_r1830216146

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the TimeSeries class and TimeSeriesDaoImpl, especially the separate loops described in the issue. Determine which column metadata and row values must be configurable at runtime, then compare the proposed builder and record APIs with current usage. Done means the design is agreed and the affected TimeSeries behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.