I have come across a problem while going though K&B book on EJB 2.0...It actually requires some knowledge of java to figure out..
I am not quoting the actual problem, although it is something like this.....I have the following classes and interfaces....
The trick is to ensure that both A and B need to have the same method signatures, but i am not allowed to make A implements B
I though that may be I could try out with something like this as
as this would check whether the method declared by B is implemented by A, but then again, B extends C, and i need to provide implementation for C, whose methods i am not aware Of.
Can you please suggest some way in which i can ensure That the method definition in A matches the method declartion in B??
P.S: just to give a background, this concerns itself with component interfaces and bean classes
If debugging is the process of removing bugs, then programming must be the process of putting them in. -- Edsger Dijkstra
From my example point of view if A implemnets B, then A has to implement C as well, whos methods A is neither aware of, nor required to implement.
From the actual problem point of view, A is a bean class and B is a component interface and C is an EJBObject. The spec requires that A should not implement B. If we do know the methods in EJBObject and we do provide the their implementation in A, then it would mean that the client would be able to directly communicate with the bean class, through the EJBObject methhods that the bean class defines, which again is a violation of Bean architecture.