• Design pattern adapter


    Introduction to adapter mode The function of adapter mode is to modify the originally incompatible interface to a unified process through adaptation, so that users can use it conveniently. In practical work, sometimes we need to make unified packaging for various types of services of each business line, and then provide external interfaces for use. […]

  • Recommend a lightweight HTTP client framework for springboot project. Come and try it!


    staySpringBootProject direct useokhttp、httpClientperhapsRestTemplatelaunchHTTPRequest is cumbersome and inconvenient for unified management. Therefore, a suitable forSpringBootProject’s lightweight HTTP client frameworkretrofit-spring-boot-starter, it is very simple and convenient to use, and provides many function enhancements at the same time. The project has been updated to2.2.2Version, and iterative optimization will continue. Project address:https://github.com/LianjiaTech/retrofit-spring-boot-starter preface RetrofitIs applicable toAndroidandJavaThe biggest feature of […]

  • How to implement the custom adapter of Axios


    catalogue 1. Functions to be realized by the adapter 1.1 promise and tools 1.2 format of response 1.3 timeout setting 1.4 active cancellation request 2. Write a custom adapter 3. Add the adapter to Axios 4. Summary 1. Functions to be realized by the adapter When we implement additional data modules based on Axios, we […]

  • Remote debugging of. Net core program deployed in Linux system using vs2019


    environment Server: centos7,. Net core 3.0, SSH Native: Windows 7, vs2019,. Net core 3.0   Vs2019 settings Step 1: set up remote connection, Tools > Options > cross platform > connection manager > Add   Enter the host address, user name and password. The default port is 22   Step 2: attach to process, debug […]

  • Talk about spring’s integration of Kafka


    order This article briefly combs some usage options of production / consumption Kafka messages in Java applications. Available class libraries kafka client spring for apache kafka spring integration kafka spring cloud stream binder kafka In addition to the official Java API class library, there are many additional packages in the spring ecology. Here is a […]

  • Android serial 38 – access contacts


    1、 Read contacts from your phone Due to the use of the simulator, we first create several contacts and then read them Then create a project contactstest and modify itactivity_main.xml First put a list in it, and then we modify itMainActivity.javaCode of package com.example.contactstest; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import […]

  • Design pattern learning 08 (Java implementation) – adapter pattern


    Write on the front Take notes on learning design patterns Improve the flexible use of design patterns Learning address https://www.bilibili.com/video/BV1G4411c7N4 https://www.bilibili.com/video/BV1Np4y1z7BU Reference article http://c.biancheng.net/view/1317.html Project source codehttps://gitee.com/zhuang-kang/DesignPattern 10, adapter mode 10.1 definition and characteristics of adapter pattern The definition of adapter is as follows:The interface of a class is converted to another interface that the […]

  • Android listview


    Listview is one of the most commonly used controls in Android. Almost all applications use it, so it is very important to learn to use it. Now let’s understand the usage of listview from an example. Let’s take a look at the project structure diagram of our example Here we first look at fruit, fruit […]

  • Analysis of Objective-C design pattern adapter


    The pattern of picture recognition A simple overview of the adapter model is: what you need is in front of you, but you can’t transform it in a short time, so we try to adapt it. For example, now a mobile phone without electricity and a 110v50hz socket are in front of you, you obviously […]

  • Well written adapter mode, decoration mode


    I hope you can enjoy it preface There are three typesFactory modelIn addition to factory mode, there are other modes of interview, which I will talk about this timeAdapter mode,Decoration modeIt’s still the old rule. Put it in theIt’s in. JavaCopy and serve Adapter mode Adapter modes are divided intoClass Adapter andobject adapter . The […]

  • Basic problems of Java


    1、long(8) and float(4)Who is the largest value range? becauselongyes8Bytes,floatyes4It’s a byte. As a rule, we can’t move up. But becausefloatIt is a floating-point type, and its calculation method is different from that of shaping ⅠFirst of alllongCan be automatically converted tofloat; For example: Long number=88888;//88888 Float newNumber=number;//88888.0 Ⅱ、longRange of values indicated:2^63-1 floatRange of values indicated:3.4 […]

  • Android serial 11 – excellent practice of news app


    1、 A best practice of using fragmentation is that we write a news app 1. First, create a news class   package com.example.fragmentbestpractice; ​ public class News { private String title; private String content; ​ public String getTitle() { return title; } ​ public void setTitle(String title) { this.title = title; } ​ public String […]