I was wondering why do we need separate Remote and Local intefaces for EJB 3.0 Session beans. I guess most of the time they would both be defining the same contract. Why can
I don't agree that at design time remote and local should be treated as trivially inter-changable.
First, there are overheads in remote invocation, so when designing remote interfaces you need to consider carefully whether you've got the granularity and parameter sizes right. So a reminder this is going to be comparatively expensive is helpful as a designer.
Also, Given that remote interfaces parameters are passed by value and local interface parameters are passed by reference there are fundamental semantic differences between the two cases hence you might choose to design the two interfaces differently.