myAmazingObject: MyAmazingClass,// this is class hint
);//This will print 'something'
Now that we have seen the simplest case of parameterless hints, let's see what would happen if we needed to specify an internal dependency.
Let's also show something closer to a real world case, let's imagine that the strings to be used for MyAmazingClass could be configured from the outside as you might need to if your applications supports many locales.
stockEndpoint: A hint for the class Endpoint. Note that the constructor receives a parameter named 'baseUrl', this matches the aux bean definition, which means that it will be injected into the stockEndpoint bean.
stockService. A hint for the class StockService, the bean created in this context will receive injected through the constructor the stockEndpoint.
A side effect of working with plain objects to store the context, is that as with as any other normal object, you can use functions to generate the context, or that you can change the context after it has been created.
You will see in the next section how this combined with the other features from dependency injection will let you for example write simpler integration tests.
We think that having a dynamic context is key to fully take advantage of the dependency injection
As of v1.0, we don't have any out of the box mechanism to help you create dynamic context, but we are hoping to change this in the near future.