Tapestry's Inversion of Control container is a built-in Tapestry module based on inversion of control (IoC), a design approach that allows a working system to be fabricated from many small, easily testable pieces.
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
An additional benefit of using IoC is that, by breaking a complex system into small pieces, it becomes easier to modify and extend the system, by overriding or replacing selected parts of the system.
...
The core concept of Tapestry IoC is that the Java language itself is the easiest and most succinct way to describe object creation and method invocation. Any approximation in XML is ultimately more verbose and unwieldy. As the Tapestry IOC examples show, a small amount of Java code and a handful of naming conventions and annotations is far simpler and easier than a big chunk of XML.
...
Another goal is "developer friendliness". This is a true cross-cutting concern, and one not likely to be packaged into an aspect any time soon. The Tapestry IoC framework is designed to be easy to use and easy to understand. Further, when things go wrong, it actively attempts to help you via comprehensive checks and carefully composed error messages. Further, all user-visible objects implement a reasonable toString() method, to help you understand what's going when you inevitably try to figure things out in the debugger.
...
Services are identified by a unique id. Typically, a service id matches the unqualified name of the service interface, but this is simply a convention.
Note |
---|
The evolutionary direction of the Tapestry IoC is to eventually eliminate service ids and work totally in terms of service interfaces and marker annotations. |
Services are aggregated into modules:
...
The point of Injection is a field, method parameter, or constructor parameter that receives an injected value. The type of service (or other dependency) is determined by the type of the field or parameter. Often, annotations further identify what is to be injected, or in the case of field injection, that an injection is required.
IoC Subtopics
Children Display |
---|