-
Notifications
You must be signed in to change notification settings - Fork 718
Idea Backlog
Remo H. Jansen edited this page May 16, 2016
·
16 revisions
Here you can find some ideas that might be implemented in the future:
- Development tool to dump-resolve all dependencies in production.
- Better caching for Node.js apps.
let kernel = new Kernel();
kernel.applyCacheProvider();
kernel.bind<T>("T").to(T).withCache({ stdTTL: 100, checkperiod: 120 });
- Browser extension to debug resolution plan and injected dependencies.
- Performance audit using flame charts.
- Worker scope.
- Request scope this could be an additional way to support a hierarchical dependency injection system.
- Compiler generated metadata.
- Middleware: contextLogger
Consider the following object composition:
interface IKatanaBlade {}
class KatanaBlade implements IKatanaBlade {}
interface IKatanaHandler {}
class KatanaHandler implements IKatanaHandler {}
@injectable("IKatanaHandler", "IKatanaBlade")
@paramNames("handler", "blade")
class Katana implements IWeapon {
public handler: IKatanaHandler;
public blade: IKatanaBlade;
public constructor(handler: IKatanaHandler, blade: IKatanaBlade) {
this.handler = handler;
this.blade = blade;
}
}
interface IWeapon {}
class Shuriken implements IWeapon {}
interface INinja {
primary: IWeapon;
secondary: IWeapon;
}
@injectable("IWeapon", "IWeapon")
@paramNames("primary", "secondary")
class Ninja implements INinja {
public primary: IWeapon;
public secondary: IWeapon;
public constructor(@tagged("throwable", false) primary: IWeapon, @tagged("throwable", true) primary: IWeapon) {
this.katana = katana;
this.shuriken = secondary;
}
}
The contextLogger
will display something like the following in console when INinja
is resolved:
└── plan
├── parentContext
└── rootRequest
├── service: "INinja"
├── bindings: [{ runtimeIdentifier: Ninja }]
├── target: null
└── childRequests
├── 0
│ ├── service: "IWeapon"
│ ├── bindings: [{ runtimeIdentifier: Katana }]
│ ├── target: { service: "IWeapon", name: "primary", metadata: [{ key: "throwable", value: false }] }
│ └── childRequests
│ ├── 0
│ │ ├── service: "IKatanaHandler"
│ │ ├── bindings: [{ runtimeIdentifier: KatanaHandler }]
│ │ ├── target: { service: "IKatanaHandler", name: "handler", metadata: [] }
│ │ └── childRequests: []
│ └── 1
│ ├── service: "IKatanaBlade"
│ ├── bindings: [{ runtimeIdentifier: KatanaBlade }]
│ ├── target: { service: "IKatanaBlade", name: "blade", metadata: [] }
│ └── childRequests: []
└── 1
├── service: "IWeapon"
├── bindings: [{ runtimeIdentifier: Shuriken }]
├── target: { service: "IWeapon", name: "secondary", metadata: [{ key: "throwable", value: true }] }
└── childRequests: []
It should also include a simplified version:
└── plan
└── "INinja" => Ninja
├── "IWeapon" => Katana
│ ├── "IKatanaHandler" => KatanaHandler
│ └── "IKatanaBalde" => KatanaBlade
└── "IWeapon" => Shuriken