Why do we need separate Remote and Local interfaces for EJB 3.0 session beans

后端 未结 6 517
忘了有多久
忘了有多久 2020-12-23 13:59

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

6条回答
  •  清歌不尽
    2020-12-23 14:32

    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.

提交回复
热议问题