资 源 简 介
The Dash Framework enables Java components to be developed with clear and documentable external dependencies on configuration, component wiring, and runtime context.
Dash Obtain
DashObtain: Provides lazy, thread-safe acquisition of fields with the @Obtain annotation. Like dependency injection, but more declarative.
Example @Obtain use (without error handling...):
```
public class Forwarder implements MessageListener {
@Obtain MessageProducer forwardTo;
public void onMessage(Message message) {
forwardTo.send(message);
}
}
```
Dash Context
DashContext: Provides "safe" global variables: a public static @Context field can be exposed in a thread-safe, thread-local, and execution scoped manner.
An example is authenticated User. Contextual and execution scoped access to the current principal user is easy to show:
```
public class Authentication {
@Context static Principal pri