Why use Facade pattern for EJB session bean

后端 未结 3 1640

I want to ask what is the reason to use Facade Pattern when access EJB Session Bean. In my Netbeans 6.9.1, if I do New > Sessions Bean for Entity Classes<

3条回答
  •  无人及你
    2020-12-15 23:38

    Yes and no. The Facade pattern makes a lot of sense, but having a separate facace per domain object makes no sense.

    You will want to group facades per groups of functionality of domain objects. Imagine a billing system. It has bills, items, customer, addresses. So you would there perhaps a Facade for bill handling (adding items, setting customer, printing, marking as paid) and a different facade for creation and update of users, associating with addresses and so on.

提交回复
热议问题