Replace XML with @annotation and JavaConfig

I’ve created two issues to replace XML support. https://issues.openmrs.org/browse/TRUNK-4666?filter=-2 https://issues.openmrs.org/browse/TRUNK-4663?filter=-2

I think we should follow modern approach and move on to annotations and java config.

1 Like

I have changed the summary and description of https://issues.openmrs.org/browse/TRUNK-4666

I left it in needs assessment to hear if others think it is worth the effort.

I do think that we should use annotations for any new entities in core and modules. However, given the amount of effort needed to convert from xml to annotations I am less inclined to change any existing entities. Anyway, I’ll let others comment on that.

I haven’t touched the other issue. Please improve the summary and description to make it clear what you propose (similarly to what I’ve done for TRUNK-4666, provide references and examples of changes needed).

I agree that it may not be useful to switch to annotations for existing entities, but is it possible to add them to the base entity classes (BaseOpenmrsObject, BaseOpenmrsMetadata, and BaseOpenmrsData)? Adding the annotations to the base classes would make it much easier for modules to switch over to annotations which is something we (OpenHMIS) would like to do in the future.

@ibewes, see https://issues.openmrs.org/browse/TRUNK-4385

I’ll back port that as far as 1.9.x.

We may need to make all our commits for the reference application to use annotations, I think doing the same for the legacy application may take much time, i personally prefer them rather than XML configuration files, for hibernate, solr/lucene, mappings etc Thanks @spereverziev for bringing this up :smile: