cẩn thận để đề cập đến tất cả các thực thể (lớp con hoặc chuyên ngành). Nhà nước hạn chế cấu trúc như chúng tồn tại. Ngữ pháp mà chúng tôi đề xuất cho các chuyên ngành / tổng quát các mối quan hệ không quốc tịch đến một máy chủ chạy EJB cùng nếu các phương pháp không được đánh dấu là idempotent | Chapter 4 Dynamic proxies can t be used to proxy for a class rathrethan an interface . However this isn t a problem if we use interface-based design. Dynamic proxies are used internally by many application servers typically to avoid the need to generate and compile stubs and skeletons. Dynamic proxies are usually used to intercept calls to a delegate that actually implements the interface in question. Such interception can be useful to handle the acquisition and release of resources add additional logging and gather performance information especially about remote calls in a distributed J2EE application . There will of course be some performance overhead but its impact will vary depending on what the delegate actually does. One good use of dynamic proxies is to abstract the complexity of invoking EJBs. We ll see an example of this in Chapter 11. The class included in the infrastructure code with the sample application is a generic dynamic proxy that fronts a real implementation of the interface in question designed to be subclassed by dynamic pro és that add custom behavior. Dynamic proxies can be used to implemenAspect Oriented Programming AOP concepts in standard Java. AOP is an emerging paradigm that is based carosscutting aspects of a system based on separation of concerns. For example the addition of logging capabilities just mentioned is a crosscut that addresses the logging concern in a central place. It remains to be seen whether AOP will generate anything like the interest of OOP but it s possible that it will at least grow to complement OOP. For more information on AOP see the following sites http . AOP home page. http . Home page for AspectJ an extension to Java that supports AOP. See the reflection guide with your JDttfefarled information about dynamic proxies. A warning I feel dangerously good after I ve made a clever use of reflection. Excessive cleverness reduces maintainability. Although I m a .