Several concepts of Java AOP, IOC, DI, DIP, Factory mode, IOC container

Source: Internet
Author: User

1. AOP: Plane-oriented programming

Some public classes, such as log classes, security classes, database connection classes, unified system authentication, Rights management classes, resource pools (such as database connection pool management), performance monitoring, etc. into a common class, when other classes need to inject (call). So these public classes survive in memory and are ready to be called by other classes, and will not end because the class of one call is finished

At run time, the programming idea of dynamically cutting code into a class, at a specified location, is a tangent-oriented programming

2. DI: Dependency Injection

Originally a class depends on other classes, in the class to declare the "concrete class" dependency, the practice of dependency injection is to rely on the class to write "abstract class", so that "abstract class" can be passed (injected) various "concrete class", dependency Injection implementation methods are: constructor, setter, interface three ways

3. DIP: Dependency Inversion principle (Dependency inversion Principle)

An important idea of software design, the original high-rise buildings rely on the underlying building "upside down", to become the bottom of the building relies on high-rise buildings. High-rise buildings decide what is needed, the bottom-level to achieve such a demand, but the upper layer does not have to control the bottom is how to achieve . I just need to tell you what I need, and I don't care how you do it.

4. IOC: Controlled inversion (inversion of control)

Control inversion is the idea of a code design that relies on inversion, and is implemented in a way that uses " Dependency Injection "

5, IOC container: is completed " according to the upper class to find the lower class, and then by the lower class step by step create, construct the process of the upper class " task

6, the project mode: a variety of similar functions of the module concentrated together, such as fruit factory, there are pineapple, apples, mangosteen, cherry, etc., when you need a specific fruit class, call this factory, pass parameters (inform is a certain fruit)

Reference:

1, https://www.zhihu.com/question/23277575

2, https://mp.weixin.qq.com/s?__biz=MzAxOTc0NzExNg==&mid=2665513179&idx=1&sn= 772226a5be436a0d08197c335ddb52b8#rd

3, http://www.runoob.com/design-pattern/factory-pattern.html

4, https://www.zhihu.com/question/24863332

5, http://www.cnblogs.com/xrq730/p/4919025.html

Several concepts of Java AOP, IOC, DI, DIP, Factory mode, IOC container

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.