Java 9 and Jigsaw project

Hello everyone,

I don’t know if this was discussed at some point, I haven’t followed OpenMRs talk for a long time. Sorry if this was already discussed but have you guys read about the Jigsaw project?

I think that can make OpenMRS development much better. Why? As a module client it was hard for me to understand which classes are “public” (public as for other modules to use) and which ones are private specific for implementation of that module and shouldn’t be used otherwise. The same as a module developer, I would like to have the ability to create an API/interface where other modules can communicate with, but hide classes that are internal implementation only so then I could change them without break compatibility with other modules. AFAIK OpenMRS doesn’t have that or at least didn’t have that well defined.

Well, the Jigsaw project fix exactly this problem and I think it would be quite important for OpenMRS to use that. It would make development easier and cleaner, less problems of module compatibility, easier testing and etc. Of course, it is a lot of work to do for all modules. But it would be good to have that in important modules such as emr-api (if it is still an important module), app framework and etc

Anyway, just food for thought, it might be good to have some discussions around that to prepare for when Java 9 gets released (early next year)

@marioareias, thanks for passing this along.

I think it’s unlikely that we’ll adopt Java 9 for the OpenMRS platform, given the difficulty of upgrading for implementations; we gave people a year’s notice to get to Java 8, and it’s only beginning to happen now. :slight_smile:

Also, I hope that pushing a lot more functionality into web front end code will mitigate some of the problems you describe.

That said, it would be nice if we could leverage better native Java support for modules, on top of the module architecture we have.