The answer is to create a generic helper class to both obtain the initial context and look up the home interface for every bean in the application 答案是创建通用助手类,它既可以为应用程序中的每个bean获取初始上下文,又可以为它们查找home接口。
Of course , there is no reason why the code used in this article could not form a method of a helper class - something that takes in three parameters , and returns the 当然,本文中使用的代码没有理由不能构成一个助手类的一个方法它带三个参数,并且返回
It will do this either by including business logic itself into its methods , or by handing the logic off to another helper class , portlet service , or an ejb 它将通过在自己的方法中包含业务逻辑本身或者将逻辑转交给另一个助手类、 portlet服务或ejb完成抽象工作。
Specifically , a business delegate is a helper class that handles the details of connecting to an ejb container , obtaining any required resources , and releasing those resources as needed 明确地讲,业务委派是一个助手类,它处理连接到ejb容器、获取任何所需资源以及按需释放那些资源的细节。
The commontracelogger aspect implements most of the action events defined in commonbase and simply invokes the commoneventhandler helper class to generate common base events Commontracelogger方面实现了commonbase中定义的大多数动作事件,只要调用commoneventhandler助手类就可以生成通用基础事件。
As in a stateless network , servlets are best used to manage client interaction , so helper classes such as javabeans are often used to handle the heavy processing or interface with back - end components 就象在无状态网络中一样, servlet最好用于管理客户机交互,那么通常可使用助手类(如javabeans )来应付繁重的处理或者与后端组件相互操作( interface ) 。
Then , wherever you need to have a lookup done , you could simply use the helper class , pass it the appropriate parameters for your current situation , and get back the object reference you need , ready to narrow to its real class 时返回的。然后,当您需要进行一次查询时,只需使用这个助手类,向它传递适合于当前情况的适当参数,取回您所需要的对象引用,并准备将它窄化到实际的类。
Once you build up a few helper classes to handle the common work of encoding and decoding your profile payloads , the beep - specific code will become a " given " and you can concentrate on the real logic of your application - which is the whole point of using beep in the first place 一旦您构建了一些助手类来处理编码和译码概要文件有效负载的共同工作,特定于beep的代码将变成一个“给定的” ,并且您可以全神贯注于应用程序的真实逻辑它首先是使用beep的全部要点。