Common design patterns in JAVA: single case, factory, observer

1. Singleton mode Only one instance object can be created per class The main purpose of the Java Singleton pattern is to ensure that only one instance of a Class class exists in a Java application.The advantage of using Singleton is that it also saves memory because it limits the number of instances and facilitates garbage collection for Java. ...

Posted on Mon, 06 Apr 2020 10:26:12 -0700 by bluemonster

How are spring application objects built? SpringBoot source code

Note: the source code analysis corresponds to spring boot version 2.1.0.RELEASE This connection What is the starting process of SpringBoot? Spring boot source code (7) Learn from the past Let's review the contents of the previous article. In the previous article, we analyzed the startup process of SpringBoot, and now we summarize the key steps: ...

Posted on Mon, 06 Apr 2020 04:56:42 -0700 by isam4m

Spring learning -- sql parameter injection of JDBC template

Turn around: sql parameter injection of [spring] JDBC template demo @Repository("jdbcDao") public class JdbcTemplateDao { @Autowired private JdbcTemplate jdbcTemplate; @Autowired private NamedParameterJdbcTemplate namedTemplate; private final static List<String> names = new ArrayList<String>(); priva ...

Posted on Mon, 06 Apr 2020 04:11:29 -0700 by jungalist

Collection of code examples of location information API calls: urban area query, POI search, etc

The following example code applies to www.apishop.net For the API under the website, you need to apply for the corresponding API service before using the interface call code examples mentioned in this article. Query of urban areas in China : 2017 latest City address of China Province Latitude and longitude address c ...

Posted on Sun, 05 Apr 2020 22:26:12 -0700 by ivalea

Android file absolute path and Content starting Uri convert to each other

https://www.jianshu.com/p/02fa61d8dbf5 Problems encountered in work. After taking pictures, the path is file:///storage/emulated/0/Android/data/com.zehin.mingchuliangzao3/cache/PostPicture/20160905182015.jpg But the path I want is: content://media/external/images/media/212304 Of this Uri type Look up the data and ...

Posted on Sun, 05 Apr 2020 22:16:50 -0700 by sarabjit

Kotlin generic strength analysis

1, What is generics 1. Generalized type or abstract type 2. An approximate implementation of duck type in static language 2, Implementation mechanism of generics 1. What is true generics? (C#) 2. What is pseudo generic? (Java,Kotlin) 3, Let's first look at the pseudo ubiquity in JAVA and Kotlin But in C ා langua ...

Posted on Sun, 05 Apr 2020 22:00:13 -0700 by danlindley

Talk about CanalAdapterService of canal

order This paper focuses on the CanalAdapterService of canal CanalAdapterService canal-1.1.4/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/CanalAdapterService.java @Component @RefreshScope public class CanalAdapterService { private static final Logger logger = LoggerFactory.getLogger(CanalAdapterSer ...

Posted on Sun, 05 Apr 2020 21:06:06 -0700 by dagee

How to download music with JAVA IO stream?

I've always liked the music that was lost. Recently, I wrote a small program with JAVA, which can download music according to journal and song number. This procedure is for learning purposes only. At present, only one preliminary code has been written: public class DownloadMusic { private static int count = 1; public ...

Posted on Sun, 05 Apr 2020 20:01:50 -0700 by skeezmo

Learn Java-7 from zero. Use array to store information

1. Create an array; 2. Set the size of the array; 3. Assign values to array elements; 4. Modify the information in the array; 5. Create multidimensional array; 6. Array sorting. Program SpaceRemover: displays the input string and replaces all space characters with period characters. 1 package com.jsample; 2 3 public class SpaceRemover { 4 ...

Posted on Sun, 05 Apr 2020 19:51:22 -0700 by gammaster

Summary of using Quartz task scheduling timer

I. Preface Quartz is an open source job scheduling framework written entirely in java. In human words, you can create some tasks, specify when and how many times they are executed. This article documents the common methods used by quartz in the project process. Official download address http://www.quartz-scheduler.org/downloa ...

Posted on Sun, 05 Apr 2020 17:07:54 -0700 by wertz33