Analysis on removing deprecated methods

Continuing the discussion from Spiking on removing deprecated methods in the API for Platform 2.0:

For a couple of days, i have been analyzing the work involved in removing deprecated methods and classes. Because there was no way i would do the analysis by just looking at the code, i ended up with this pull request:

My goal was to see what it would take to have the platform compiling and having all existing unit tests passing, after removing deprecated methods. I removed all the deprecated methods and classes apart from just the three remaining in classes ContextMockHelper, PersonAttributeType and PatientIdentifier. I would need a few more hours to look into these.

The work in this pull request includes not only the actual removals, but also the changes in the affected areas. I feel that it should be reviewed and potentially merged such that we do not throw away this work, though it was just supposed to be an analysis. :smile:

Any questions? Issues for clarification? etc?



Does this work involving building the reference application to see if any modules are affected, or will that show up the next time the modules have to be built?

When this work is accepted and merged in, we shall test the modules and see its effect on them.

Iā€™ll look into the pull request later today.

ContextMockHelper is a class introduced by me to make it possible to write JUnits using mocks for calls to Context.getServiceā€¦ I deprecated it so that people follow best DI practices by declaring dependencies as class fields instead of using Context.getServiceā€¦

That said ContextMockHelper should not be removed as we have a lot of code calling Context.getServiceā€¦ and we need a way to test that code easily.

1 Like

On the first pass, i attempted to remove it. But got errors in some tests that were not obvious to fix. So i ended up putting it back. :slight_smile: