[Interview] [Spring FAQ summary] [03], spring FAQ 03

Source: Internet
Author: User

[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.

Related Article

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.