This option is not correct because it converts analytics.jar into named module. Am I correct?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.
About Question enthuware.ocpjp.ii.v11.2.3430 :
Moderators: Site Manager, fjwalraven
-
- Posts: 28
- Joined: Tue Jun 19, 2018 10:27 am
- Contact:
About Question enthuware.ocpjp.ii.v11.2.3430 :
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
Yes, as explained in option 2. Added explanation to this option as well.
thank you for your feedback!
thank you for your feedback!
-
- Posts: 9
- Joined: Tue Sep 05, 2023 4:07 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
I almost guessed wrong, because you state "module-info.java", where it could (or should) be "module-info.class".
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
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?
-
- Posts: 9
- Joined: Tue Sep 05, 2023 4:07 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
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.
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.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
OK, I see your point. May be just "module-info" would be better?
-
- Posts: 9
- Joined: Tue Sep 05, 2023 4:07 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
That would certainly improve the situation.
-
- Posts: 6
- Joined: Sun Sep 15, 2024 12:42 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
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.
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’m sure you’re aware of this, and I hope this feedback helps in refining the instructions.
Best regards
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
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!
thank you for your feedback!
-
- Posts: 1
- Joined: Tue Feb 25, 2025 3:13 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3430 :
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
Spunki
Who is online
Users browsing this forum: Google [Bot] and 9 guests