-
Notifications
You must be signed in to change notification settings - Fork 1
Container – API
new Container()The container is a component that implements Service Location of services and it's itself a container for them. Since the server is highly decoupled, it is essential to integrate different components. The developer can also use this component to inject dependencies and manage global instances of the different classes used in the application.
Basically, this component implements the "Inversion of Control" pattern: the objects do not receive their dependencies using setters or constructors, but requesting something similar to "service dependency injector". This reduces the overall complexity since there is only one way to get the required dependencies within a component. Additionally, this pattern increases testability in the code, thus making it less prone to errors.
Sets the value for the key in the Container object. Returns the Map object.
Returns the value associated to the key, or defaultValue if there is none.
Returns a boolean asserting whether a value has been associated to the key in the Container object or not.
Removes any value associated to the key and returns true if it was deleted successfully, or false otherwise.
Removes all key/value pairs from the Map object.
Returns the number of key/value pairs in the Map object.
This Wiki and indvidual modules READMEs contains a lot of information – please take your time and read these instructions carefully.