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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
teodorj
Posts: 28
Joined: Tue Jun 19, 2018 10:27 am
Contact:

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

Post 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?

admin
Site Admin
Posts: 10383
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Yes, as explained in option 2. Added explanation to this option as well.
thank you for your feedback!

AlienFS
Posts: 9
Joined: Tue Sep 05, 2023 4:07 am
Contact:

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

Post by AlienFS »

I almost guessed wrong, because you state "module-info.java", where it could (or should) be "module-info.class".

admin
Site Admin
Posts: 10383
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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?

AlienFS
Posts: 9
Joined: Tue Sep 05, 2023 4:07 am
Contact:

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

Post 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.

admin
Site Admin
Posts: 10383
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

OK, I see your point. May be just "module-info" would be better?

AlienFS
Posts: 9
Joined: Tue Sep 05, 2023 4:07 am
Contact:

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

Post by AlienFS »

That would certainly improve the situation.

_umut_
Posts: 6
Joined: Sun Sep 15, 2024 12:42 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10383
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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!

tommchris
Posts: 1
Joined: Tue Feb 25, 2025 3:13 am
Contact:

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

Post 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

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests