ome / omero-ms-queue

GNU General Public License v3.0
3 stars 5 forks source link

Avoid external lib deps in util #11

Open c0c0n3 opened 7 years ago

c0c0n3 commented 7 years ago

Currently util depends on a handful of external libs but those dependencies are only needed for extra functionality (Spring & servlet utils, Yaml serialisation) that's only used in Smuggler. The new kew* projects don't use any of those libs and the soon-to-be-implemented rendering micro service (#8) won't need them either. To avoid the extra jars being added to the kew project's runtime, I'm using a non-transitive dependency on util in the kew build file. So we could take the stance that util can depend on external libs and any project that uses a util class depending on an external lib, should add that lib to its classpath. But it may be cleaner to move util classes that depend on external libs to separate projects so we could have:

The downside is that we'd have even more projects with just a handful of classes in them. Not sure which approach is best. Comment if you have any preferences!

c0c0n3 commented 6 years ago

Serialization

While we decide on what to do with the dependency issues above, I moved JSON/YAML serialisation out of the server component into util---see PR #16.

The new classes sit in the util.serialization package and can be reused by other components---I've done this since I'll need serialisation functionality for the rendering micro-service. If we decide to have a separate util-serialization project, all we need to do is move the whole package across to the new project and remove the Snake Yaml and Gson dependencies from util.gradle.