Reverse Control (IOC)

xiaoxiao2021-03-06  112

With Spring, Hibernate popular, IOC has recently become a hot word, then what is the reverse control?

it's actually really easy. IOC (Inversion of Control) and OOP DIP (Dependence Inversion) and Martin Fowler said Dependency Injection

http://martinfowler.com/articles/injection.html is the same. Also known as the Hollywood Principle. Objective To reduce coupling.

Less coupling uses the configuration file, initial TXT, to the Window's INI file, registry, to the recent XML file.

How to read the configuration file? Now there is generally specialized classes (Configuration, or Context).

Then use the factory mode (Factory class) to instantiate specific classes (Instance) through Java Reflection.

Main program business logic uses an abstaact or interface.

转载请注明原文地址:https://www.9cbs.com/read-97765.html

New Post(0)