-
10
pages
-
English
-
Documents
Description
Java Injection (CanDI) Pattern TutorialJune 15, 2009Contents1 Overview 11.1 Tutorial Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Java Injection API . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Service Pattern 42.1 Using Services from PHP and JSP . . . . . . . . . . . . . . . . . 53 Resource XML Con guration Pattern 64 Startup Pattern 95 Plugin/Extension Pattern 91 OverviewThe four main CanDI patterns share a common goal: improve code with adeclarative injection style. When Java classes cleanly describe their dependen-cies, their lifecycles, and their exports, they are self-documenting. You can readthe classes and understand how they will behave, i.e. you don’t need to read thecode 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 annotationsare 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 asigni cant coding burden, and are well worth the small extra development time.CanDI Application PatternsPATTERN DESCRIPTIONService Pattern Organize the application as a collec-tion of services.11.1 Tutorial Architecture 1 OVERVIEWResource Con guration Pattern Bind and resources with declara-tive ...
-
Publié par
-
Langue
English