Documentation on `invoke()` warned against overusi...
# ktor
t
Documentation on
invoke()
warned against overusing it, right now I am using it for all my uses cases e.g
Copy code
class CreateNewSubCategory @Inject constructor(private val subcategoryRepository: SubCategoryRepository){
    suspend operator fun invoke(category: Subcategory): Int = subcategoryRepository.createSubCategory(category)
}
Is there any detriment to that?
d
If you do
s/CreateNewSubCategory/SubCategoryFactory/
then I think that's fine.
t
Sorry I don't understand, I am using guice to inject the usecases directly into my controller and calling
useCaseName()
for example whenever I need it
d
Rename
CreateNewSubCategory
to
SubCategoryFactory
.
t
Okay thanks, though CreateNewSubCategory is a usecase, not a factory