Using openmrs-module-clientregistry to Connect OpenMRS to Open Client Registry

So @ibacher you certainly have dug much deeper into this than I have.

The main rule we have was “don’t autowire within services” (specifically those that wrapped things in a transaction proxy factory bean, ie: openmrs-module-emrapi/api/src/main/resources/moduleApplicationContext.xml at master · openmrs/openmrs-module-emrapi · GitHub) because that that always seemed to slow things down by an order of magnitude or more (see my last post around this: Improviding Speed of OpenMRS - During Development and support - #11 by mogoodrich).

However, we’ve basically used @Autowired in freely outside of services. Based on your comments, we may have to reconsider this as well?

Doing a grep of my module code base I see many cases where were are doing conponent-scans within modules, are you saying we can and should remove these to potentially see faster startup time?

mgoodrich@mgoodrich-ThinkPad-P1-Gen-4i:~/development/openmrs/modules$ grep -r 'component-scan' .
./webservices.rest_old/omod-common/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./webservices.rest_old/omod-common/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./webservices.rest_old/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./webservices.rest_old/omod/target/webservices.rest-2.40.0-SNAPSHOT.5f651f/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./labonfhir/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.labonfhir"/>
./authentication/omod/target/authentication-1.0.0-SNAPSHOT/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.authentication.web" />
./authentication/omod/target/authentication-1.0.0-SNAPSHOT/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.authentication" />
./authentication/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.authentication.web" />
./authentication/omod/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.authentication" />
./authentication/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.authentication.web" />
./authentication/api/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.authentication" />
./authentication/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.authentication" />
./initializer/omod/target/initializer-2.5.0-SNAPSHOT/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.initializer.web.controller" />
./initializer/omod/target/initializer-2.5.0-SNAPSHOT/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.initializer" />
./initializer/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.initializer.web.controller" />
./initializer/omod/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.initializer" />
./initializer/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.initializer.web.controller" />
./initializer/api/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.initializer" />
./initializer/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.initializer" />
./initializer/validator/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.initializer.validator" />
./reporting/omod/target/reporting-1.26.0-SNAPSHOT/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.reporting.web" />
./reporting/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.reporting.web" />
./reporting/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.reporting.web" />
./sync/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.sync.web.controller" />
./labtrackingapp/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.labtrackingapp" />
./idgen/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.idgen" />
./idgen/omod/target/idgen-4.9.0-SNAPSHOT/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.idgen" />
./idgen/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.idgen" />
./legacyui/omod/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.legacyui" />
./legacyui/omod/target/legacyui-1.13.0-SNAPSHOT/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.legacyui" />
./legacyui/api/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.legacyui" />
./legacyui/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.legacyui" />
./reportingrest/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="@MODULE_PACKAGE@" />
./attachments/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan
./ordertemplates/omod/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.ordertemplates.web" />
./ordertemplates/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.ordertemplates" />
./dbevent/omod/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.dbevent" />
./dbevent/omod/target/dbevent-1.0.0-SNAPSHOT/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.dbevent" />
./dbevent/api/target/classes/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.dbevent" />
./dbevent/api/src/main/resources/moduleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.dbevent" />
./addresshierarchy/omod/target/classes/webModuleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.addresshierarchy" />
./addresshierarchy/omod/target/addresshierarchy-2.16.0-SNAPSHOT/webModuleApplicationContext.xml:    <context:component-scan base-package="org.openmrs.module.addresshierarchy" />
./addresshierarchy/omod/src/main/resources/webModuleApplicationContext.xml:    <context:component-scan base-package="@MODULE_PACKAGE@" />
./htmlformentry/omod/target/htmlformentry-5.2.0-SNAPSHOT/ui2ModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.htmlformentry" />
./htmlformentry/omod/target/classes/ui2ModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.htmlformentry" />
./htmlformentry/omod/src/main/resources/ui2ModuleApplicationContext.xml:	<context:component-scan base-package="@MODULE_PACKAGE@" />
./webservices.rest/omod-common/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./webservices.rest/omod-common/src/main/resources/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./webservices.rest/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./webservices.rest/omod/target/webservices.rest-2.40.0-SNAPSHOT.5bed49/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.webservices.rest.web"/>
./appointmentscheduling/omod/target/appointmentscheduling-1.18.0-SNAPSHOT/webModuleApplicationContext.xml:    <context:component-scan base-package="@MODULE_PACKAGE@" />
./appointmentscheduling/omod/target/appointmentscheduling-1.18.0-SNAPSHOT/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.appointmentscheduling.web.controller" />
./appointmentscheduling/omod/target/classes/webModuleApplicationContext.xml:    <context:component-scan base-package="@MODULE_PACKAGE@" />
./appointmentscheduling/omod/target/classes/webModuleApplicationContext.xml:	<context:component-scan base-package="org.openmrs.module.appointmentscheduling.web.controller" />
./appointmentscheduling/omod/src/main/resources/webModuleApplicationContext.xml:    <context:component-scan base-package="@MODULE_PACKAGE@" />
./appointmentscheduling/omod/src/main/resources/webModuleApplicationContext.xml:<context:component-scan base-package="org.openmrs.module.appointmentscheduling.web.controller" />

1 Like