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
Currently, the TaskMetrics and ErrorHandlerTask types are defined as a struct. While this serves our immediate needs, it tightly couples our metrics implementation, which can limit our flexibility in the future.
Proposal:
Right now, the way we use (TaskMetrics and ErrorHandler) as a struct works, but it can make changes harder in the future.
We can change the TaskMetrics/ErrorHandler from being a struct to an "interface".
Benefits:
Make Testing Easier: With interfaces, making mocks for tests is simpler.
Extensibility: By defining the behaviors we expect in an interface instead of being tied to a specific structure implementation, we can add other types in the future without changing existing code.
Next steps:
Define two new interfaces: TaskMetricsInterface and ErrorHandlerInterface.
Refactor the current TaskMetrics struct to implement the TaskMetricsInterface and the ErrorHandler struct to implement the ErrorHandlerInterface.
Update references in our application to use TaskMetricsInterface instead of the TaskMetrics struct and ErrorHandlerInterface instead of the ErrorHandler struct.
Context:
Currently, the TaskMetrics and ErrorHandlerTask types are defined as a struct. While this serves our immediate needs, it tightly couples our metrics implementation, which can limit our flexibility in the future.
Proposal:
Right now, the way we use (TaskMetrics and ErrorHandler) as a struct works, but it can make changes harder in the future.
We can change the TaskMetrics/ErrorHandler from being a struct to an "interface".
Benefits:
Next steps:
🔗 zboto Link
The text was updated successfully, but these errors were encountered: