Thursday, May 29, 2014

ADF how to: how to deal with base class that extends oracle.jbo.server.ApplicationModuleImpl

I have here one ADF exercise:

An application module is named MyAppModule. No Java component is defined for
the module but the application does define a base class that extends oracle.jbo.server.ApplicationModuleImpl.
Which two statements are true in this scenario?
A. Code In the base class will only be implemented if MyAppModuleAppl.java extends the base class.
B. Any code in the base class will be implemented by MyAppModule.
C. No code in the base class will be implemented because an application-specific Java component named MyAppModuleImpl.java does not exist.
D. Any code in the base class will be implemented by MyAppModuleDefimpl.java.
E. The MyAppModule. xml definition will include a reference to the base class.

The first issue here is, if is it possible to ADF Model objects to extend custom classes without defining Java "components". Short answer is: yes, it is.

Mpre info about extending ADF Bussiness Components functionality you can find in Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework. The chapter 36.1 says:

"One of the powerful features of framework-based development is the ability to extend the base framework to change a built-in feature to behave differently or to add a new feature that can be used by all of your applications."

To create your own extension you should create custom Java class which extends selected ADF Business Components component class, by example oracle.jbo.server.ApplicationModuleImpl.

But Developer's Guide says:

"After creating a new framework extension class, it will not automatically be used by your application. You must decide which components in your project should make use of it."

What should be done is select extension class. Every ADF Business Components wizard and editor displays the same Class Extends button on the Java page. Here you can select class which you want extend.

Backing to our test, we have proposed answers from A to E, but which are correct?

A. Wrong, what is " MyAppModuleAppl.java"? Or there is an error in the proposed answer, cause if we will replace MyAppModuleAppl.java with MyAppModuleImpl.java, the answer will be correct.
B. Wrong answer.
C. Correct answer.
D.Also wrong answer, cause our base class extends oracle.jbo.server.ApplicationModuleImpl, and not oracle.jbo.server.ApplicationModuleDefImpl.
E. This is not true, wrong answer.

What do you  think about my answers?

No comments:

Post a Comment