Tag:Parent class

  • Spring source code analysis 4: bean construction loading, attribute value analysis, annotation scanning


    Spring source code analysis 4: bean construction loading, attribute value analysis, annotation scanning The previous article mainly introduced the registration, parsing and instantiation of beans, but left some points to be resolved: ConstructorResolver.autowireConstructorHow to construct, load and instantiate CglibSubclassingInstantiationStrategy.instantiateHow to dynamically instantiate a bean BeanDefinitionValueResolver.resolveValueIfNecessaryHow to resolve attribute values MergedAnnotations.fromHow to scan annotations In this […]

  • C + + foundation-6-inheritance


    6. Succession 1 #include 2 using namespace std; 3 4 5 class Base { 6 public: 7 Base() { 8 m_A = 10; 9 } 10 int m_A; 11 12 }; 13 14 class Son: public Base { 15 public: 16 Son() { 17 m_A = 20; 18 } 19 int m_A; 20 }; 21 […]

  • Spring source code analysis IX: default annotation processor


    Spring source code analysis IX: default annotation processor staySpring source code analysis 5: bean configuration, definition and registrationIn, there are some default annotation processors that have not been parsed ConfigurationClassPostProcessor AutowiredAnnotationBeanPostProcessor CommonAnnotationBeanPostProcessor PersistenceAnnotationBeanPostProcessor EventListenerMethodProcessor DefaultEventListenerFactory 1. ConfigurationClassPostProcessor ConfigurationClassPostProcessorThe main function of is [email protected] public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPostProcessor, PriorityOrdered, ResourceLoaderAware, ApplicationStartupAware, BeanClassLoaderAware, EnvironmentAware { //Post […]

  • On virtual function table


    Author: Snow Mountain fat fish Time: 22:50, 20210825 Objective: to understand the virtual function table Position of virtual function Virtual functions have no fixed position and should be related to the compiler. In vs2017 and G + +, it is at the beginning of the object #include <iostream> using namespace std; class A { public: […]

  • Java polymorphic parent class reference points to subclass object (upward transformation)


    For example, I have a parent class animal , and a subclass cat , cat class inherits animal, which is the subclass inherits the parent class Animal a = new cat() what does that mean? This is to create a parent class reference to a child class object. What are the benefits of doing so? […]

  • Playing with __ attributes__ (IV)


    objc_designated_initializer usage method @interface MyObject:NSObject – (instancetype)init __attribute__((objc_designated_initializer)); @end It can also be written in IOS – (instancetype)init NS_DESIGNATED_INITIALIZER; This property specifies the initialization method of the class. Specifying the initialization method is not for the user. But to the internal reality. For example, the following situation Example explanation @interface MyObject:NSObject – (instancetype)initMyObject NS_DESIGNATED_INITIALIZER; – […]

  • Detailed explanation of typescript class, inheritance and modifiers public, private and protected


    1. Class I understand Class can be understood as a template through which a specific object can be instantiated For example: we define an animal class, This animal template can be instantiated into a cat or other specific animals 2. Basic use of class We need to create an animal class; This animal has a […]

  • IOS message mechanism obj_ Msgsend and super


    1、 Premise View OC compiled code: xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc main.mCan generate main M compiled file will generate main Cpp file is the file from OC to C. We can analyze some OC features through this cpp file. 2、 Message mechanism obj_ msgsend 1. Analysis through several figures: [picture uploading… (screenshot 2021-07-03, […]

  • Solid principle of software design pattern


    Solid principle of software design pattern By: guest granting QQ: 1033553122 #Single responsibility principle (SRP) Definition: any software module is only responsible for a certain type of actors Note: in most cases, the “software module” here can be simply defined as a source code file, a class, a group of closely related functions and data […]

  • PHP core feature – trait


    The trail syntax of PHP is very simple, and it is more important to understand the usage scenario of trail. propose Why does PHP introduce trail? Let’s first look at two common code reuse modes in software development,inheritandcombination。 Inheritance: EmphasisParent and child classesThat is, the subclass is a special type of the parent class; Combination: […]

  • IOS custom KVO


    preface Principle analysis of IOS KVOIn this article, we analyze the principle of KVO. Next, we simply implement a KVO by ourselves. preparation First build a rokvo project, and then build a roviewcontroller, which is associated in the storyboard, as shown in the figure: 1 KVO customization idea We know that KVO is realized by […]

  • Object oriented design principle (solid principle)


    1、 Single responsibility The principle of single function is also called the principle of single responsibility. In short, a class should have only one reason for its change. Its central idea is high cohesion and low coupling in the principle of object-oriented design. When more than one reason causes a class to be modified, try […]