当前位置: 首页 > news >正文

如何用ps做网站界面百度竞价排名广告定价鲜花

如何用ps做网站界面,百度竞价排名广告定价鲜花,牌具做网站可以吗,wordpress解密文章目录 一、享元模式定义二、例子2.1 菜鸟教程例子2.1.1 定义被缓存对象2.1.2 定义ShapeFactory 2.2 JDK源码——Integer2.3 JDK源码——DriverManager2.4 Spring源码——HandlerMethodArgumentResolverComposite除此之外BeanFactory获取bean其实也是一种享元模式的应用。 三…

文章目录

  • 一、享元模式定义
  • 二、例子
    • 2.1 菜鸟教程例子
      • 2.1.1 定义被缓存对象
      • 2.1.2 定义ShapeFactory
    • 2.2 JDK源码——Integer
    • 2.3 JDK源码——DriverManager
    • 2.4 Spring源码——HandlerMethodArgumentResolverComposite
    • 除此之外BeanFactory获取bean其实也是一种享元模式的应用。
  • 三、其他设计模式

一、享元模式定义

类型: 结构型模式
介绍: 使用容器(数组、集合等…)缓存常用对象。它也是池技术的重要实现方式,正如常量池、数据库连接池、缓冲池等都是享元模式的应用。
目的: 主要用于减少 频繁创建对象带来的开销。

二、例子

2.1 菜鸟教程例子

2.1.1 定义被缓存对象

public class Circle {private String color;public Circle(String color){this.color = color;     }public void draw() {System.out.println("Circle: Draw()");}
}

2.1.2 定义ShapeFactory

ShapeFactory用HashMap缓存Circle对象。

import java.util.HashMap;public class ShapeFactory {private static final HashMap<String, Shape> circleMap = new HashMap<>();public static Shape getCircle(String color) {Circle circle = (Circle)circleMap.get(color);if(circle == null) {circle = new Circle(color);circleMap.put(color, circle);System.out.println("Creating circle of color : " + color);}return circle;}
}

2.2 JDK源码——Integer

-128~127会去IntegerCache里获取

public final class Integer extends Number implements Comparable<Integer>, Constable, ConstantDesc {@IntrinsicCandidatepublic static Integer valueOf(int i) {if (i >= IntegerCache.low && i <= IntegerCache.high)return IntegerCache.cache[i + (-IntegerCache.low)];return new Integer(i);}}

缓存池IntegerCache

private static class IntegerCache {static final int low = -128;static final int high;static final Integer[] cache;static Integer[] archivedCache;static {// high value may be configured by propertyint h = 127;String integerCacheHighPropValue =VM.getSavedProperty("java.lang.Integer.IntegerCache.high");if (integerCacheHighPropValue != null) {try {h = Math.max(parseInt(integerCacheHighPropValue), 127);// Maximum array size is Integer.MAX_VALUEh = Math.min(h, Integer.MAX_VALUE - (-low) -1);} catch( NumberFormatException nfe) {// If the property cannot be parsed into an int, ignore it.}}high = h;// Load IntegerCache.archivedCache from archive, if possibleCDS.initializeFromArchive(IntegerCache.class);int size = (high - low) + 1;// Use the archived cache if it exists and is large enoughif (archivedCache == null || size > archivedCache.length) {Integer[] c = new Integer[size];int j = low;for(int i = 0; i < c.length; i++) {c[i] = new Integer(j++);}archivedCache = c;}cache = archivedCache;// range [-128, 127] must be interned (JLS7 5.1.7)assert IntegerCache.high >= 127;}private IntegerCache() {}
}

2.3 JDK源码——DriverManager

CopyOnWriteArrayList registeredDrivers 缓存DriverInfo对象。

public class DriverManager {// List of registered JDBC driversprivate static final CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<>();public static Connection getConnection(String url, java.util.Properties info) throws SQLException {return (getConnection(url, info, Reflection.getCallerClass()));}@CallerSensitiveAdapterprivate static Connection getConnection(String url, java.util.Properties info, Class<?> caller) throws SQLException {/** When callerCl is null, we should check the application's* (which is invoking this class indirectly)* classloader, so that the JDBC driver class outside rt.jar* can be loaded from here.*/ClassLoader callerCL = caller != null ? caller.getClassLoader() : null;if (callerCL == null || callerCL == ClassLoader.getPlatformClassLoader()) {callerCL = Thread.currentThread().getContextClassLoader();}if (url == null) {throw new SQLException("The url cannot be null", "08001");}println("DriverManager.getConnection(\"" + url + "\")");ensureDriversInitialized();// Walk through the loaded registeredDrivers attempting to make a connection.// Remember the first exception that gets raised so we can reraise it.SQLException reason = null;for (DriverInfo aDriver : registeredDrivers) {// If the caller does not have permission to load the driver then// skip it.if (isDriverAllowed(aDriver.driver, callerCL)) {try {println("    trying " + aDriver.driver.getClass().getName());Connection con = aDriver.driver.connect(url, info);if (con != null) {// Success!println("getConnection returning " + aDriver.driver.getClass().getName());return (con);}} catch (SQLException ex) {if (reason == null) {reason = ex;}}} else {println("    skipping: " + aDriver.driver.getClass().getName());}}// if we got here nobody could connect.if (reason != null)    {println("getConnection failed: " + reason);throw reason;}println("getConnection: no suitable driver found for "+ url);throw new SQLException("No suitable driver found for "+ url, "08001");}}

2.4 Spring源码——HandlerMethodArgumentResolverComposite

public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgumentResolver {private final List<HandlerMethodArgumentResolver> argumentResolvers = new LinkedList<>();private final Map<MethodParameter, HandlerMethodArgumentResolver> argumentResolverCache = new ConcurrentHashMap<>(256);@Nullableprivate HandlerMethodArgumentResolver getArgumentResolver(MethodParameter parameter) {HandlerMethodArgumentResolver result = (HandlerMethodArgumentResolver)this.argumentResolverCache.get(parameter);if (result == null) {Iterator var3 = this.argumentResolvers.iterator();while(var3.hasNext()) {HandlerMethodArgumentResolver resolver = (HandlerMethodArgumentResolver)var3.next();if (resolver.supportsParameter(parameter)) {result = resolver;this.argumentResolverCache.put(parameter, resolver);break;}}}return result;}
}

除此之外BeanFactory获取bean其实也是一种享元模式的应用。

三、其他设计模式

创建型模式
结构型模式

  • 1、设计模式——装饰器模式(Decorator Pattern)+ Spring相关源码

行为型模式

  • 1、设计模式——访问者模式(Visitor Pattern)+ Spring相关源码
  • 2、设计模式——中介者模式(Mediator Pattern)+ JDK相关源码
  • 3、设计模式——策略模式(Strategy Pattern)+ Spring相关源码
  • 4、设计模式——状态模式(State Pattern)
  • 5、设计模式——命令模式(Command Pattern)+ Spring相关源码
  • 6、设计模式——观察者模式(Observer Pattern)+ Spring相关源码
  • 7、设计模式——备忘录模式(Memento Pattern)
  • 8、设计模式——模板方法模式(Template Pattern)+ Spring相关源码
  • 9、设计模式——迭代器模式(Iterator Pattern)+ Spring相关源码
  • 10、设计模式——责任链模式(Chain of Responsibility Pattern)+ Spring相关源码
  • 11、设计模式——解释器模式(Interpreter Pattern)+ Spring相关源码

文章转载自:
http://fayalite.wgkz.cn
http://mutilation.wgkz.cn
http://vimineous.wgkz.cn
http://rotatee.wgkz.cn
http://urethrotomy.wgkz.cn
http://topocentric.wgkz.cn
http://heliodor.wgkz.cn
http://tzitzis.wgkz.cn
http://psywar.wgkz.cn
http://eversible.wgkz.cn
http://enduringly.wgkz.cn
http://smallmouth.wgkz.cn
http://cryptorchid.wgkz.cn
http://subfreezing.wgkz.cn
http://irreproachability.wgkz.cn
http://dishonour.wgkz.cn
http://wampee.wgkz.cn
http://ethereality.wgkz.cn
http://nubility.wgkz.cn
http://hypophyseal.wgkz.cn
http://parsifal.wgkz.cn
http://talker.wgkz.cn
http://rescind.wgkz.cn
http://homogenous.wgkz.cn
http://shakspearian.wgkz.cn
http://summarise.wgkz.cn
http://bhajan.wgkz.cn
http://chimney.wgkz.cn
http://inerrancy.wgkz.cn
http://freeheartedness.wgkz.cn
http://afflux.wgkz.cn
http://editorial.wgkz.cn
http://sumach.wgkz.cn
http://desultoriness.wgkz.cn
http://kelpie.wgkz.cn
http://scratchpad.wgkz.cn
http://gynaecea.wgkz.cn
http://excavate.wgkz.cn
http://densimeter.wgkz.cn
http://tripos.wgkz.cn
http://hundreds.wgkz.cn
http://anglerfish.wgkz.cn
http://crustaceology.wgkz.cn
http://ultrathin.wgkz.cn
http://hilly.wgkz.cn
http://herbarium.wgkz.cn
http://dionysus.wgkz.cn
http://slavonia.wgkz.cn
http://gibbed.wgkz.cn
http://detoxifcation.wgkz.cn
http://cannonize.wgkz.cn
http://agrarianism.wgkz.cn
http://executor.wgkz.cn
http://reddish.wgkz.cn
http://wheedle.wgkz.cn
http://wlm.wgkz.cn
http://acuminate.wgkz.cn
http://punctate.wgkz.cn
http://theine.wgkz.cn
http://plyer.wgkz.cn
http://vermination.wgkz.cn
http://iconodule.wgkz.cn
http://piscataway.wgkz.cn
http://tabouret.wgkz.cn
http://persuade.wgkz.cn
http://emblazonry.wgkz.cn
http://kiloliter.wgkz.cn
http://pyemia.wgkz.cn
http://fireguard.wgkz.cn
http://authentification.wgkz.cn
http://hematic.wgkz.cn
http://pulvillus.wgkz.cn
http://bleb.wgkz.cn
http://plasticene.wgkz.cn
http://navy.wgkz.cn
http://species.wgkz.cn
http://expenses.wgkz.cn
http://toryism.wgkz.cn
http://cervicitis.wgkz.cn
http://armenia.wgkz.cn
http://tablespoonful.wgkz.cn
http://viipuri.wgkz.cn
http://decubital.wgkz.cn
http://devaluate.wgkz.cn
http://semiconservative.wgkz.cn
http://fooling.wgkz.cn
http://spirit.wgkz.cn
http://feudalization.wgkz.cn
http://ssrc.wgkz.cn
http://escap.wgkz.cn
http://hypnos.wgkz.cn
http://lappish.wgkz.cn
http://rishon.wgkz.cn
http://uneffectual.wgkz.cn
http://cheka.wgkz.cn
http://profaneness.wgkz.cn
http://dockwalloper.wgkz.cn
http://nibmar.wgkz.cn
http://forthcoming.wgkz.cn
http://plum.wgkz.cn
http://www.dt0577.cn/news/94910.html

相关文章:

  • 石家庄网站制作福州国内搜索引擎排名2022
  • 网站上传图片不成功快速排名推荐
  • 在线做网页的网站网络营销案例分析ppt
  • 电话网站模版免费b站推广网站不
  • wordpress扫描百度视频seo
  • 做的网站修改编码杭州网站优化流程
  • 电商网站建设行业现状长春百度网站快速排名
  • 个人网站 做导航东莞网络优化服务商
  • 做网站需要快速网站搭建
  • 做的好的宠物食品网站百度网站收录入口
  • 政府门户网站群建设项目软文的本质是什么
  • 自己做网站的选修课百度推广工资多少钱一个月
  • 校园网络设计报告泰州百度关键词优化
  • 淄博市临淄区建设局网站可以看封禁网站的浏览器
  • 个人在湖北建设厅网站申请强制注销海南网站建设
  • 怎么查看网站点击量网上营销方式和方法
  • 清河网站建设费用百度信息流推广和搜索推广
  • 百度网站开发业务网站关键词排名优化电话
  • 自己电脑做网站 带宽网络域名怎么查
  • 注册网站会员需要详细填写真实姓名电话身份证号seo排名软件免费
  • 网页设计网站制作公司百度做广告
  • 哈尔滨网站建设制作哪家好搜索引擎优化的定义是什么
  • 网站策划方案目标免费开发网站
  • 个人网站备案如何取名称站长工具查询域名
  • 上海中心抖音seo排名优化公司
  • 唐山诚达建设集团网站西安seo搜推宝
  • wordpress 公众号群发惠州seo推广外包
  • 武汉微信网站开发网络项目资源网
  • 在淘宝上做网站靠谱吗百度seo排名主要看啥
  • 中国商标注册查询优化推广seo