No. September 16 interview summarize (nantian)

1.spring understanding of
Spring is a one-stop, lightweight javaee framework. Spring refers to the one-stop support in the persistence layer, business layer, javaEE develop the presentation layer, lightweight refers to the addition to the four core package, other features introduced on demand. Spring is the core ioc, Inversion of Control, the code control by the caller into a service side, the decoupling function. Spring caller to get the object from the container, through dependency injection DI
Spring achieve the IOC, which has several forms:
Example of a fourth embodiment Bean:
1. No argument constructor
2. static factory method
3. physical plant
4. FactoryBean implementation Interface
Spring dependency injection:
1.setter injection
2. constructor injection
3.p namespace injection
4. values of the set injection

2.spring aop understanding of
the service layer in the actual development of the transaction to be processed, the operation log, etc., regardless of these operations and business code, and a large number of repeat, these codes need to be extracted.
Java dynamic proxy using technology to solve, create a proxy object class service layer, when the method of the proxy object to call the real object, before the method execution, after which an exception, eventually accordingly enhanced.
jdk dynamic proxy: the proxy object must implement the interface
CGlib dynamic proxy: final modification is not required classes, methods agent must be non-final, non-static, non-private

3.hibernate and mybatis difference
hibernate: ORM fully object-relational mapping based on the database before the operation, will build relationships with entities like database tables, database operated by the operating entity of the class object, do not write sql statement to achieve,
Hibernate set of code compatible with multiple databases
mybatis: persistence framework, to achieve zero-persistence layer, no need to write the implementation class code directly via a database interface operation, automatically encapsulated data to an object, the developer custom sql statement
but the result set field names and attribute automatic inconsistent name, using manual mapping resultmapping

4.collection which incorporates
List the Set Queue
List:: ArrayList LinedList List orderly disorder is not the only unique set
the Set :: HashSet TreeSet LinkedHashSet
the Map: HashMap TreeMap LinkedHashMap

5. Multi-threaded understood
in two ways to achieve multi-threading: inheritance Thread, implement Runnable
life cycle: newborn, ready, running, blocking, death

6. How to achieve thread-safe
security thread: thread synchronization, so that the operation atomicity
sync block: sync all the synchronization code block into sychronized
synchronization method: The general method for modifying synchronized, synchronization monitor synchronization method is this method calls
between threads communications:. thread.wait (), thread ( ) notify

7. A common design pattern
simple factory mode, single-mode embodiment, proxy mode, the chain of responsibility design pattern

8. simple singleton pattern implemented
1. private constructor with no arguments, to avoid creating instance external
static variables 2. private; why static, static method must be called as static variables;
3 public static methods; why static , the method class may be used directly

9.springcloud use in the project
1. Use Registry eureka registration services and discovery services discoveryClient eurekaClient manage
2. openfeign communicate between systems, remote call
3. To achieve eureka high availability (clustering configuration)

10.activemq embodying the principles of
the message queue servers, be used:
1. The multi-module decoupling: high cohesion, low coupling, using solr index database updated in real time
2. Flow clipping (resolved concurrent requests): the front end of the discharge data to the message queue, the rear end of the message from the queue are sequentially processed acquired
3. synchronous asynchronous processing operations: a user test service, the user data stored in the database, only the user's mailbox on the queue, the listener by the authentication program is acquired from the queue E-mail, send certified.

Guess you like

Origin www.cnblogs.com/WhiperHong/p/11529922.html