为什么在EJB中使用facade模式? [英] Why use facade pattern in EJB?

查看:146
本文介绍了为什么在EJB中使用facade模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了文章尝试了解为什么要在客户端和实体bean之间建立一个会话bean。这是因为通过让客户端直接访问实体bean,您可以让客户端了解所有关于数据库的所有信息?

I've read through this article trying to understand why you want a session bean in between the client and entity bean. Is it because by letting the client access entity bean directly you would let the client know exactly all about the database?

所以通过让中间人(会话bean)通过以某种方式实现业务逻辑,让客户端了解数据库的一部分。所以只有与客户端相关的数据库的一部分才可见。

So by having middleman (the session bean) you would only let the client know part of the database by implementing the business logic in some certain way. So only part of the database which is relevant to the client is only visible. Possibly also increase the security.

推荐答案

ul>

  • 避免客户端和

  • 减少细粒度的方法调用,导致通过网络最小化方法调用调用,为客户端提供粗粒度的访问。

  • 可以集中安全交易限制。

  • 更大的灵活性应付变更的能力。

  • 仅显示必要的&为客户提供更简单的界面,隐藏底层复杂性和内部细节,业务组件之间的相互依赖关系。

    • Avoiding tight coupling between the client & the business objects, increasing manageability.
    • Reducing fine-grained method invocations, leads to minimize method invocation calls over the network, providing coarse-grained access to clients.
    • Can have centralized security & transaction constraints.
    • Greater flexibility & ability to cope with changes.
    • Exposing only required & providing simpler interface to the clients, hiding the underlying complexity and inner details, interdependencies between business components.
    • 这篇关于为什么在EJB中使用facade模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆