How to segregate imports of module being 'aware of' away from Spring wiring?

If things were done “the other way around” as you describe. So if Ext I18N depends on Bahmni Core and provides the implementation for the API that Bahmni Core exposes, then what would happen at runtime when Bahmni Core is not loaded? I believe we would just bump on the exact same issue as the one described above on this thread. Ext I18N would face a ClassNotFoundException for every interface of Bahmni Core that it is meant to implement.


Also things are a lot more intricate than that when it comes to AH and hierarchical address entries, and this exact instruction illustrates it well:

getAddresses(transform(retrieveAddressHierarchyEntries(ahService, level, searchString, parentEntry, limit)))

When address entries are internationalized (and saved as language-independent codes) something like a search string becomes a bit of a nightmare as you can imagine. There is no way anymore to leverage on Hibernate or Lucene queries directly, a whole new layer must be introduced to allow for such searches.

This is one of the multiple reasons why nothing much happens at the controller level but rather deeper at the service implementation level. See also around this post for the rationale behind the directions that were taken a few months back.