Page 1 of 1

About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Fri Jan 08, 2021 12:06 pm
by teodorj
1. Convert ojdbc8.jar into automatic module.
2. Convert analytics.jar into a named module by adding module-info.java to it.
In this module-info, export all packages that are used by reports.jar and add requires clauses for all packages of ojdbc.jar that are used by analytics.jar.
3. Convert reports.jar into a named module. Add requires clause for analytics module in reports's module-info.java.
This option is not correct because it converts analytics.jar into named module. Am I correct?

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Fri Jan 08, 2021 10:38 pm
by admin
Yes, as explained in option 2. Added explanation to this option as well.
thank you for your feedback!

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Thu Oct 26, 2023 6:11 am
by AlienFS
I almost guessed wrong, because you state "module-info.java", where it could (or should) be "module-info.class".

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Thu Oct 26, 2023 12:01 pm
by admin
The problem statement clearly asks you the steps that will be required to modularize your application. How will you add a requires clause to module-info.class unless you write it in module-info.java?

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Thu Oct 26, 2023 1:32 pm
by AlienFS
I totally understand what you are saying and I did clearly read that myself. The answers however don't clearly state you need to write a source file and add the compiled file to the .jar.

When you write in answers:
- 1: "reports.jar in its module-info.java"
- 2: "module-info.java to these jars."
- 3: "in reports.jar in its module-info.java"
- 4: "analytics.jar into a named module by adding module-info.java to it"

I cannot help but consider it a trick question as:
- 1: will not work, that file is not present in the .jar. It's will be present in the source folder, but not in the .jar.
- 2: will not work, needs to be .class for the desired effect.
- 3: will not work, that file is not present in the .jar.
- 4: will not work, needs to be .class for the desired effect.

The question doesn't state you need to recompile everything in your approach and it *could* be done simply by adding a module-info.class to the existing .jar. The answers, to me, hint to the latter approach.

In short: conceptually I totally knew what to do, but none of the answers make sense to me because of the .java extension.

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Thu Oct 26, 2023 11:23 pm
by admin
OK, I see your point. May be just "module-info" would be better?

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Fri Oct 27, 2023 4:10 am
by AlienFS
That would certainly improve the situation.

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Tue Sep 17, 2024 9:21 am
by _umut_

1. Convert ojdbc8.jar into automatic module. 2. Convert analytics.jar into a named module by adding module-info to it. In this module-info, export all packages that are used by reports.jar and add requires clauses for all packages of ojdbc8.jar that are used by analytics.jar. 3. Convert reports.jar into a named module. Add requires clause for analytics module in reports's module-info.
This is incorrect because of the second point. You shouldn't convert jars from other groups (aka third party jars) to named modules on your own as explained above.
I wanted to provide some feedback on the module conversion instructions. While modifying third-party JARs like ojdbc8.jar and analytics.jar is generally not appropriate, the more critical issue is that requires clauses should reference entire modules rather than individual packages.

I’m sure you’re aware of this, and I hope this feedback helps in refining the instructions.

Best regards

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Tue Sep 17, 2024 9:23 pm
by admin
Right. It is already mentioned in the explanation for option 2 that requires clauses are used to specify modules (not packages). Will add in this option also.
thank you for your feedback!

Re: About Question enthuware.ocpjp.ii.v11.2.3430 :

Posted: Tue Feb 25, 2025 3:15 am
by tommchris
This approach ensures that the application remains maintainable and compatible with future updates of the third-party libraries. Modifying external JARs can lead to conflicts and maintenance challenges, especially when updating to newer versions provided by the library maintainers.
Spunki