How should I design my current CORBA applications with an eye to migrating easily to EJBs later?

Use the following guidelines:

  1. Break all service IDL into a factory and the actual implementation. This will map to Home/Remote interfaces nicely.
  2. Store all your factories in CosNaming. This will map nicely to JNDI.
  3. Use design patterns which mimic the EJB types: stateless session objects, stateful session objects, and entity beans. The corollary of this is to avoid building services which are not supportable by EJB. For example, avoid singleton objects, which are not easily supported in EJB.

Following these basic guidelines should allow most of your services to migrate to EJB with minimal modification.

Note, however, that there is nothing wrong with using a hybrid architecture. It is reasonable to expect that some services will be easily ported to EJB and some will be hard to port. Any EJB server built on IIOP should support hybrid deployments easily, allowing you to migrate your services over time or, in some cases, not at all.