Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Fri Jun 02, 2017 1:14 pm
by johnlong
Define a local interface for localMethod and a remote interface for remoteMethod and have the bean implement both the interfaces.
Would not it be necessary in case of implementing two interfaces to annotate both of interfaces with @Local and @Remote or put those annotations with the reference to interfaces on bean class itself?

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sat Jun 03, 2017 12:03 am
by admin
Yes, annotations are a part of defining a local or remote interface or of defining a bean. Just like import statements are.

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sat Jun 03, 2017 7:53 am
by johnlong
But it is not mentioned in the answer that annotations have to be places, so one can assume that it has not been done, thus considering that the answer as wrong(incomplete).
In exams, we assume (we are told) that imports are in place if not defined explicitly, but we don't have such assumption for annotations. It does not make sense to make such assumption in general.

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sat Jun 03, 2017 10:11 pm
by admin
I am sorry but I do not agree with your point.
The option says, "Define a local interface for localMethod and a remote interface for remoteMethod and have the bean implement both the interfaces."

So it is not really asking you to assume just the annotations. It is asking you to define the whole thing including everything that defining a locale interface entails. This instruction is complete in itself.

If you are asked to define a class, would you need a separate instruction to write package statements, import statements, extends clause, and all other parts that may be required to define that class?

-Paul.

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sat Jun 10, 2017 8:47 am
by johnlong
If you are asked to define a class, would you need a separate instruction to write package statements, import statements, extends clause, and all other parts that may be required to define that class?
Class can exist without package, import statements, extends clause, etc, i.e - it still would be valid class

But in our case implementation would not be valid without required annotations. If annotation were optional, I would agree with you.

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sun Jun 11, 2017 12:02 am
by admin
The option says "define a local interface". It doesn't just say, "define an interface". The phrase "local interface" has a specific meaning in this context. You can't define a local interface by just defining an interface. An interface will become a local interface only when all the required elements of a local interface are fulfilled including annotations and/or xml configuration. Same for "remote interface"

So I am sorry but I still disagree with your argument.

thank you,
Paul.

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sun Jun 11, 2017 9:18 am
by johnlong
Do you mean that this is not testing candidate knowledge in regards to how to define properly local and remote interface, and goes to higher level?
BTW, as I understood EJB 3.2 dropped the requirement for explicit @Local and @Remote annotations?

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Sun Jun 11, 2017 9:47 pm
by admin
If you look at all the options, you will see that the question is testing you on whether you know "what" you need to do and not on "how" to do it.

Re: About Question enthuware.oce-ejbd.v6.2.365 :

Posted: Mon Jun 12, 2017 9:10 am
by johnlong
I see, thank you.