From d294b58e2cb3f13d83432ec3b4acbf1fc2891569 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Tue, 2 Apr 2024 12:43:19 +0530 Subject: [PATCH] chore: Add comment on using annotation injections of beans --- .../repositories/ce/BaseAppsmithRepositoryCEImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java index b37fede231..ef374e4d23 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java @@ -63,6 +63,14 @@ import static org.apache.commons.lang3.StringUtils.isBlank; * the understanding of these interfaces. * ``` * Ref: https://theappsmith.slack.com/archives/CPQNLFHTN/p1669100205502599?thread_ts=1668753437.497369&cid=CPQNLFHTN + *

+ * Note, we use the {@code @Autowired} annotation for bean injection here, instead of using constructor injection. This + * is an intentional exception to the usual recommendation. The reason is that this class is a base class for all other + * repository classes, and using constructor params would require all repository classes to have the same constructor + * params, and corresponding {@code super} calls. This was causing a lot of conflicts between CE and EE, and other + * additional overhead, with very little value to speak for. Hence, we are using {@code @Autowired} here. + *

+ * Ref Slack thread. */ public abstract class BaseAppsmithRepositoryCEImpl {