:thread: - Where do y’all put your extension func...
# spring
j
🧵 - 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
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
If I can make them private then I put them in the file that needs them, outside any class declarations if possible
+ 1
👍 1