You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order "force" the developer to define a method for certain classes we are using Abstract classes with a method that throws ( for instance the AbstractTracker ).
This approach has different downfalls:
The error will throw only at runtime.
We are adding more code to the bundle.
If the developer knows about the asbtract class he probably already knows that he has to implement those methods. If he doesn't know, he will not extend from it, and no error will be thrown at runtime.
A more convenient solution would be to create a custom eslint rule which would apply to all the files inside a path. For instance we could define a rule where is mandatory for all the classes living inside the path features/metrics to define a static buildFromJson method.
The text was updated successfully, but these errors were encountered:
In order "force" the developer to define a method for certain classes we are using Abstract classes with a method that throws ( for instance the AbstractTracker ).
This approach has different downfalls:
A more convenient solution would be to create a custom eslint rule which would apply to all the files inside a path. For instance we could define a rule where is mandatory for all the classes living inside the path features/metrics to define a static buildFromJson method.
The text was updated successfully, but these errors were encountered: