(no commit message)
[utils] / support / inject / src / main / java / org / wamblee / inject / package-info.java
1 /*
2  * Copyright 2005-2010 the original author or authors.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 /**
17  * This package provides a mini-framework for interfacing to existing dependency injection 
18  * mechanisms. This package does not provide dependency injection, but implementations are expected to 
19  * implement it, usually by delegating to an existing dependency injection framework. The interfaces in this
20  * package provide independence on the actual framework chosen and also allow for better testability. 
21  * 
22  * <h2>Users of the package</h2>
23  * 
24  * <p>Users of this package will typically use: </p>
25  * <ul>
26  *   <li> <code>Injector</code>: This is the interface used to perform injection of dependencies into 
27  *        a given object. </li>
28  *   <li> <code>Injectable</code>: By subclassing this class, the classes automatically get their 
29  *        dependencies injected at construction. </li>
30  *   <li> <code>InjectorBuilder</code>: To get an instance of the  <code>Injector</code>.
31  *   </li>
32  * </ul>
33  * 
34  * <p>For example, to inject into a given object, use:</p>
35  * <pre>
36  *   Injector injector = InjectorBuilder.getInjector();
37  *   MyPojo pojo = new MyPojo();
38  *   injector.inject(pojo);
39  * </pre>
40  * 
41  * <h2>Implementors of the package</h2>
42  * 
43  * <p>Of interest to implementations of this package integrating with dependency injection frameworks are: </p>
44  * <ul>
45  *   <li> <code>Injector</code>: The main interface to be implemented is the {@link Injector}, by which injection is done.</li>
46  *   <li> <code>InjectorFactory</code>: Injectors are created by an implementation of the {@link InjectorFactory} which 
47  * creates injectors based on the class.</li>
48  *   <li> <code>InjectorBuilder</code>: Implementations must make their <code>InjectorFactory</code>
49  *       available through the <code>ServiceLoader</code> mechanism. 
50  *   </li>
51  * </ul>
52  * 
53  * <p>Class overview</p>
54  * <img src="doc-files/Class_Diagram__overview.png"/>
55  *
56  */
57 package org.wamblee.inject;
58