Tag:Single case

  • [Special Topic on JVM] from overview to detailed explanation, including in-depth analysis of mind map!

    Time:2021-1-23

    Overview of JVM JVM is a specification for computer equipment. It is the software implementation of a fictitious computer. In short, JVM is a container for running byte code programs. It has an interpreter component, which can realize the communication between Java bytecode and computer operating system. Java programs only need to be compiled once […]

  • Go singleton mode

    Time:2021-1-21

      Wiki Encyclopedia: Singleton pattern, also known as singleton pattern, is a common software design pattern. When applying this pattern, the class of singleton object must ensure that only one instance exists. Most of the time, the whole system only needs to have one global object, which helps us coordinate the overall behavior of the […]

  • IOS singleton macro definition record

    Time:2021-1-13

    Mysingleton. H: Singleton macro definition – header file //How to use. H add //Mysingletonh (singleton class) // singleton mode //Usage: m add //Mysingletonm (singleton class) // singleton mode //Mysingletonh. H file – creates a mysingletonh. H global file #define MYSingletonH(name) + (instancetype)shared##name; #if __has_feature(objc_arc) #define MYSingletonM(name) \ static id _instace; \ \ + (id)allocWithZone:(struct _NSZone […]

  • Java se foundation consolidation (5): Enumeration

    Time:2021-1-2

    Enumeration is available in many programming languages, such as C / C + +, but Java didn’t add this feature until JDK 1.5. I don’t know why it was so late. So what is enumeration? Wikipedia has the following definition: inmathematicsandcomputer scienceIn theory, the number of a setenumerationIs a program that lists all members of […]

  • Mongodb serverstatus implementation principle

    Time:2020-12-22

    CmdServerStatusThe run() function of isserverStatusThe concrete implementation of command First, add some global information to result ergodic_sections, callappendSection, all registeredSectionResults are added to result callMetricTree::theMetricTree->appendTo(), will allMetricThe indicator is added to the result Some additional information meanwhileCmdServerStatusAnd maintained one_sections(map structure) stores the section name and detailsServerStatusSectionThe corresponding relationship of. provideaddSectionFunction to add a section to […]

  • Don’t you understand the lazy loading principle of spring and bean every day?

    Time:2020-12-15

    Normal bean initialization is performed in the container startup initialization phase, while lazy init decorated beans are performed from the container for the first time context.getBean (“).When spring starts, it will parse all bean information (including XML and annotations) into beandefinition that spring can recognize and store it in HashMap for the following initialization.Next, each […]

  • Core learning 3: examples of using containers

    Time:2020-12-11

    We can see the following sentence in the startup class: // This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); services.AddSession(); } To inject the […]

  • Explain the advantages and disadvantages, points for attention and usage scenarios of singleton mode

    Time:2020-12-6

    Knowing what you can’t do is more important than knowing what you can do. Introduction of singleton mode: Singleton, also known as singleton, is a common software design pattern. When applying this pattern, classes of singleton objects must ensure that only one instance exists. Most of the time, the whole system only needs to have […]

  • Why does spring use level 3 caching to solve circular dependency?

    Time:2020-12-1

    Focus on “Su San Shuo technology”, reply: there are surprises in development manual and time management. Maybe some friends don’t know about spring’s circular dependency. Let’s take a look at this example first. @Service public class AService { private BService bService; public AService(BService bService) { this.bService = bService; } public void doA() { System.out.println(“call doA”); […]

  • Implementation of AOP control transaction by JDK and cglib dynamic proxy

    Time:2020-11-29

    Implementation of AOP control transaction by JDK and cglib dynamic proxy preface Or follow upCustom implementation of IOC container in XML In this instance, there is no transaction operation, and the transaction consistency in a thread operation cannot be maintained; @Override public void transfer(String fromCardNo, String toCardNo, int money) throws Exception { Account from = […]

  • Spring 5 Chinese parsing core – bean scope of IOC container

    Time:2020-11-23

    When you create abeanWhen defining, you can create a template (recipe) throughbeanDefine the class definition to create a real instance.beanThe concept of definition as a recipe is important because it means that, just like using classes, you can create multiple object instances from a single recipe. You can not only control to insert from specificbeanDefine […]

  • Five design schemes of singleton mode

    Time:2020-11-14

    Singleton pattern is a common development and design pattern. Its main purpose is to ensure that there is only one instance object. That is to say, when you want the function of a class to be single, and you only need one instance object to complete it, you can use singleton pattern to save memory […]