目的:根据不同策略来执行对象的相应操作 和工厂模式很像,不同点在于: 工厂模式是传入参数后创建对象,根据传入的参数写逻辑来判断应该创建什么类型的对象,模式的使用者调用对象统一的方法操作。 策略模式是模式的使用者必须先创建好对象,将该对象作为参数传进去,然后通过该对象调用相应的方法。 设计场景如下: ...
分类:
其他好文 时间:
2020-04-06 11:34:51
阅读次数:
52
在spring中beanPostProcessor绝对是开天辟地的产物,给了程序员很多自主权,beanPostProcessor即常说的bean后置处理器。 一、概览 先来说下InstantiationAwareBeanPostProcessor,这个后置处理器是BeanPostProcessor的 ...
分类:
编程语言 时间:
2020-04-05 22:28:05
阅读次数:
81
Kubernetes 安全之访问控制 本文将主要分享以下三方面的内容: 1. Kubernetes API 请求访问控制 2. Kubernetes 认证 3. Kubernetes RBAC 4. Security Context 的使用 Kubernetes API 请求访问控制 访问控制 大家 ...
分类:
Web程序 时间:
2020-04-05 13:23:42
阅读次数:
87
项目结构如下(Idea) 代码 package com.syu.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuratio ...
分类:
编程语言 时间:
2020-04-05 09:17:12
阅读次数:
99
package com.syu.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ViewCont ...
分类:
编程语言 时间:
2020-04-05 09:14:39
阅读次数:
98
{ 工具类代码 public native static String getAssetStringUseJNI(Context context,String path); 1NDK代码#include <jni.h>#include <assert.h>#include <string.h>#in ...
分类:
移动开发 时间:
2020-04-04 00:14:25
阅读次数:
191
150行代码实现图形化数独游戏 "Github地址" ,欢迎各位大佬们fork、star啥的,感谢; 今天闲着没事干,以前做过html+js版的数独,这次做个python版本的,界面由pygame完成,数独生成由递归算法实现,由shuffle保证每次游戏都是不一样的情况,have fun; 功能列表 ...
分类:
编程语言 时间:
2020-04-03 18:32:51
阅读次数:
72
1:状态模式的类图设计 类图地解释: State接口和Context类地关系:其中State接口中依赖于Context因为State中Handle方法要使Context的状态变化,所以其形参为Context类型,变化的实质就是内部State引用指向不同对象的变化。而Context类内部有一个Stat ...
分类:
其他好文 时间:
2020-04-03 18:32:24
阅读次数:
53
adapter 用自己定义的 image 讲解 package com.zsch.forestinventory.adapter;import android.content.Context;import android.net.Uri;import android.support.v7.widge ...
分类:
移动开发 时间:
2020-04-03 13:44:40
阅读次数:
78
通过实例快速入门Pandas在数据分析, 机器学习中的应用. ...
分类:
其他好文 时间:
2020-04-02 21:03:01
阅读次数:
111