chore: Add comment on using annotation injections of beans

This commit is contained in:
Shrikant Sharat Kandula 2024-04-02 12:43:19 +05:30 committed by GitHub
parent 2af8c4ef42
commit d294b58e2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
* <p>
* 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.
* <p>
* <a href="https://theappsmith.slack.com/archives/CPQNLFHTN/p1711966160274399">Ref Slack thread</a>.
*/
public abstract class BaseAppsmithRepositoryCEImpl<T extends BaseDomain> {