Avalon basic concepts (4) - IoC model
IoC Avalon is the background one of the key design principles. IoC principle of mandatory safety design.
IoC meaning
Between designers object to the creation of a commission on the specific sectors of information linked to the response. One of the main means: Father-control target object. So, IoC SAX API is not, because it is the purpose of information-from a source to the processor.
The definition is similar to the military chain of command (Chain of Command). Military recruits they need to provide the basic things the implementation of the rank of the operation, publishing recruits must comply with the order. The same principle applied to the code. Examples of components from each entity (instantiating entity) to provide the necessary operations, and then examples of entities acting on how to implement the components.
This definition of a similar number of different: his officers to the rank than the person who publishes small orders. And in the development, in order to ensure safety, there is no such model. IoC object from a father (control) to a subset of objects (the control). A father can have sub-objects, that is the subject of an object can only have one parent object.
How to use IoC
IoC use a very simple approach to application. This means that the use of passive component architecture (passive) structure, as in the following examples:
Class MyComponent
Implements LogEnabled
(
Logger logger;
Public enableLogging (Logger newLogger)
(
This.logger = newLogger;
)
MyMethod ()
(
Logger.info ( "Hello World!");
)
)
MyComponent examples of the type of MyComponent father set up Logger, call myMethod (). Component is involuntary, because the father was given by the configuration of the Logger.
Apart from the father category, had not MyComponent statement unless it needs to give the father of the realization of MyComponent not available Logger achieve are cited.








0 Comments to “Avalon basic concepts (4) - IoC model”
No Comments. Send your comment.
Leave a Reply
You must be logged in to post a comment.