[Interview] [Spring FAQ summary] [03], spring FAQ 03
21. Automatic Bean Detection
To configure automatic detection, you must use the <context: component-scan> element. By default, <context: component-scan> uses the classes marked by constructor. These special annotations are as follows:
@ Component -- generic constructor annotation that identifies this class as a Spring Component
@ Controller -- Define the class as SpringMVC controller
@ Respository -- identifies the class as a data warehouse
@ Service -- identify to define this class as a Service
22. filter component Scanning
You can adjust the scan behavior by configuring the <context: include-filter> and/or <context: exnclude-filter> sub-elements for <context: component-scan>.
<Context: include-filter type = "xxx" expression = "yyy"/>
23. Concerns (concern)
1) core concern: focus on the business logic of the system --> OOP
2) cross-cutting concerns: Focus on system-level services, such as transactions, security, and logs-> AOP
24. aspect ):
We extract the duplicate code that is scattered across the system and related to the cross-cutting concerns to form a module, which is called a plane.
25. Connection Point (joinpoint ):
A point in the process of running the program, such as method call, attribute access, and exception throw.
26. pointcut ):
A set of connection points. Note: If you want to selectively intercept methods in the target object, you need to define the starting point.
27. advice or notification:
Without modifying the original code, you can add new functions (such as transaction service and Log service) to an object. In spring, the enhancement is implemented by the interceptor.
28. Weaving ):
Apply the cut surface to the target object to create a new proxy object.
29. target object ):
Objects that need to be enhanced are called target objects, also known as enhancement objects or proxies.
30. proxy object)
A new object generated by adding new functions to the target object is called a proxy object. It is used to call methods of the interceptor and target object.