Thursday 25 February 2021

time Things done Thu 25 Feb 2021 Early 14 Consider: javaweb-mybatis-spring
Morning buns, porridge
09.00-09.50 8. DI dependency injection environment (constructor injection: subscript assignment, construction parameter type, construction parameter name) 9. Set injection of dependency injection (Spring container injects values ​​for properties by calling the set method of beans. And in the xml file , the way to use set injection is through the property tag)
10.00-10.50 10. c naming and p namespace injection (expanded injection) 1.p naming: by using p namespace injection in xml, the value of the attribute can be injected directly: 2.c naming: by using c namespace injection in xml , injected through the constructor: construct-args. The usage of the c namespace is similar to the p namespace, which corresponds to the constructor-arg, that is, the constructor-arg element can be replaced with an attribute of the bean that starts with the c namespace prefix. 11. Scope of Beans In Spring, beans can be defined in two modes: prototype (multiple instances) and singleton (singleton) 1. Singleton mode (Spring default mechanism) Every time you get from the container, the is to use the same object scope="singleton". By default scope="singleton", then the bean is a singleton, and anyone who obtains the bean instance is the same instance; singleton (singleton): only one shared instance exists, and all requests for this bean will return The only instance of this. 2. Prototype mode: every time you get from the container, a new object scope="prototype" scope="prototype" will be generated, and any instance is a new instance; prototype (multiple instances): for each instance of this bean Each request creates a new bean instance, similar to new. 12. Autowire Beans. First use the environment to build: a person has two pets. Autowire with autowire="byName". byName : When a bean node has the attribute of autowire byName, it will find all the set method names setCat, setDog, setName in its class people, get the string with the set removed and the first letter lowercase , and then go to the spring container to find out whether an object with this string name id . If there is, take out the injection; if not, report a null pointer exception. byName corresponds to id, and byType corresponds to class.
11.00-11.30 13. Annotation realizes automatic assembly. Using byName and byType is more troublesome, so the use of annotations to achieve automatic assembly is introduced.
noon Express delivery is inconvenient.
15.00-15.50 13. Annotation realizes automatic assembly. There was a problem before and it has now been fixed. 14. Spring annotation development The Spring annotation method reduces the content of the configuration file, making it easier to manage, and the use of annotations can greatly improve development efficiency! Instead of providing a set method, you can directly add @value("value") to the name and inject it on the set method. If a set method is provided, add @value ("value") to the set method; derived annotation @Controller: web layer; @Service: service layer; @Repository: dao layer; 15. Use JavaConfig to implement configuration. Using JavaConfig this way can completely replace the configuration of the xml file. Full power to java to implement the configuration. @Configuration. Regarding the configuration method of this Java class, we will see a lot of 16 and last week's content review in SpringBoot and SpringCloud in the future.
16.00-16.50 17. Static proxy mode. The proxy mode can add and enhance some functions by extending the proxy class without modifying the proxy object. It is worth noting that the proxy class and the proxy class should implement an interface together, or inherit a class together. Using client renter, proxy, landlord, this example explains static proxy. Why is a static proxy called static? Because its type is pre-booked. 18. Re-understanding of static proxy. The advantages of the proxy mode do not change the original code and increase business functions. New functionality has been added to UserServiceProxy. 19. What are the advantages of dynamic proxy detailed explanation? ? ? http://www.imooc.com/learn/214 I learned a course explaining the agency model on the MOOC online - "The Secret of the Model - The Agency Model". I sighed at Mr. David's awesome PPT. At the same time, the teacher took a step by step. Imitate JDK source code to write code, teach us to simply implement dynamic proxy in JDK, and speak clearly and thoroughly. I will take notes here, the original address of the course: http://www.imooc.com/learn/214
17.00-17.30 20、AOP实现方式一 也没咋看懂。
傍晚 面。麻汁鸡丝拌面
19.00-19.50 Java mvc:4、初识SpringMVC+6、深入SpringMVC学习
20.00-20.50 7、使用注解开发SpringMVC+8、Controller配置总结
21.00-21.50 8、Controller配置总结。实现接口Controller定义控制器是较老的办法。最好不要使用这种方法。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324115929&siteId=291194637