What's the purpose: api.jar + impl.jar + bundle.jar?

前端 未结 4 1605
情歌与酒
情歌与酒 2021-01-12 02:47

I see many Java packages have api, impl and bundle jars (name-api.jar, name-impl.jar, name-bundle.jar). Could someone explain what those mean? Are all three needed by the ap

4条回答
  •  情话喂你
    2021-01-12 03:21

    I've never seen such an arrangement.

    If the designer packaged the app into three JARs, then I'd say all three are needed.

    But you should recognize that it's just a choice made by the designer. It's possible that s/he could have just created a single JAR with everything in it and you'd be none the wiser.

    I'm guessing now, but if you were to open those JARs you'd see only interfaces in the API JAR, implementations of those interfaces in the impl JAR, and resource bundles and other .properties files in the bundle JAR. Try it and see. You'll learn something.

提交回复
热议问题