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 each func like command.NewApproveTrainingRescheduleHandler(trainingsRepository, /*...*/) we are passing trainingsRepository each time different (passed-by-value).
Can we use a pointer there avoiding maybe useless memory consumption?
The text was updated successfully, but these errors were encountered:
Sure, there's no issue with using pointers to repositories or other adapters. In most cases, you would find the effect on memory negligible, though. In the example above, the only field of the struct is a pointer, so copying it won't be noticeable in any way.
Given the repository in repository.go:
we are creating new structs which implement that interface using code such as in trainings_firestore_repository.go:
and we are create commands and queries with those structs, such as in service.go:
satisfying func signature like:
Question
In each func like
command.NewApproveTrainingRescheduleHandler(trainingsRepository, /*...*/)
we are passingtrainingsRepository
each time different (passed-by-value).Can we use a pointer there avoiding maybe useless memory consumption?
The text was updated successfully, but these errors were encountered: