Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

Replace interfaces with real classes #143

Open
ghost opened this issue May 2, 2019 · 0 comments
Open

Replace interfaces with real classes #143

ghost opened this issue May 2, 2019 · 0 comments
Labels
enhancement New feature or request frontend Only relevant for our frontend
Milestone

Comments

@ghost
Copy link

ghost commented May 2, 2019

Data that isn't coming from some external API but is created within the code itself, should not use interfaces but real classes.

Example:

interface ISearchData {
  title?: string;
  note?: string;
  primaryNumber?: string;
  secondaryNumber?: string;
  textRecognitionEnabled?: boolean;
  isInGroup?: boolean;
  dateFrom?: Date;
  dateTo?: Date;
  tags?: Array<string>;
}

When we switch to creating a real class for the object, the object itself can manage its status... For example the primary and secondary number can never be negative, or the order of dateFrom and dateTo needs to be consistent.

@ghost ghost added enhancement New feature or request frontend Only relevant for our frontend labels May 2, 2019
@ghost ghost added this to the v0.x-NEXT milestone May 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request frontend Only relevant for our frontend
Projects
None yet
Development

No branches or pull requests

0 participants