You can read the classes and understand how they will behave, i.e. you don’t need to read the code side-by-side with XML con guration to understand the system’s behavior. The custom, typesafe binding annotations are key to CanDI’s self- documentation, because injection points clearly describe the resources or ser- vices they expect with adjective-oriented annotations. Because the annotations are true Java classes, they are documented in JavaDoc and veri ed by the com- piler. The small number of meaningful adjectives means they don’t impose a signi cant coding burden, and are well worth the small extra development time. CanDI Application Patterns PATTERN DESCRIPTION Service Pattern Organize the application as a collec- tion of services. 1 1.1 Tutorial Architecture 1 OVERVIEW Resource Con guration Pattern Bind and resources with declara- tive annotations and con gure with XML. Startup Pattern Use @Startup beans to initialize ap- plication state. Plugin/Extension Pattern Discover plugin/extension classes for a service. This tutorial describes four main CanDI design patterns: services, resources, startup and extensions. Services center an application’s design by encapsulating management and data. Resources are the con gurable interface between the user and the application. Startup initializes the application. And extensions allow sophisticated applications to tailor...
Website: www.caucho.com | Filesize: 149kb
No of Page(s): 10
Download Java Injection (CanDI) Pattern Tutorial.pdf
No comments:
Post a Comment