My question is around how to do JNDI lookup of resources (EJB, Data Source, Topic, Queues etc) in WebSphere 6.1 or 7.0.
As I understand there are following two ways to achieve this in WebSphere:
1. By declaring resource references in ejb-jar.xml or web.xml and then looking up as follows:
2. By using corba style provider URL method, which doesn't require declaring resource reference any where in the system:
I know that approach #1 allows an additional layer of abstraction but it is at times not possible. For example: If you have an EJB which uses Command GOF design pattern to invoke java classes, which in turn call different EJB's. It it becomes difficult to add EJB reference for almost every EJB in the system in the main EJB.
Similarly it is not practical to add ejb reference for all ejb's in web.xml. The web.xml keeps changing in a large project and second it requires you to use RAD/RSA to add resource references.
Can you please provide me any compelling reason of why I should not use the second approach?
Thanks for reading and possibly responding to this issue.