🧵 - Where do y’all put your extension functions? I have some protobufs in my gRPC service. Some people are writing extension functions for these protos in the
@Service
component, some in models.kt. I’ve seen extensions.kt in other places… Wdyt?
j
Jacob
11/24/2021, 4:59 PM
I think of extension functions similar to any static method in java. If they have to be public then I put them in a Util.kt file. I would not put them in a @Component. Mixing spring managed component member functions and public static functions confuses me.
Again this is all assuming they must be public. If I can make them private then I put them in the file that needs them, outside any class declarations if possible
❤️ 2
n
nfrankel
11/24/2021, 8:40 PM
If I can make them private then I put them in the file that needs them, outside any class declarations if possible