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

中国风网站欣赏制作网页的网站费用属于资本性支出吗

中国风网站欣赏,制作网页的网站费用属于资本性支出吗,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源码——Integer2.3 JDK源码——DriverManager2.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 HashMapString, 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 ComparableInteger, 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 CopyOnWriteArrayListDriverInfo 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 applications* (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 ListHandlerMethodArgumentResolver argumentResolvers new LinkedList();private final MapMethodParameter, 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 Pattern5、设计模式——命令模式Command Pattern Spring相关源码6、设计模式——观察者模式Observer Pattern Spring相关源码7、设计模式——备忘录模式Memento Pattern8、设计模式——模板方法模式Template Pattern Spring相关源码9、设计模式——迭代器模式Iterator Pattern Spring相关源码10、设计模式——责任链模式Chain of Responsibility Pattern Spring相关源码11、设计模式——解释器模式Interpreter Pattern Spring相关源码
http://www.pierceye.com/news/943760/

相关文章:

  • 国外网站流量查询企业网站报价单
  • 聊城高唐网站建设公司wordpress设置域名
  • 有帮忙做儿童房设计的网站吗东莞横沥网站制作
  • 国外网站模板欣赏WordPress 编辑器修改默认字号
  • 厦门同安网站建设视频购物网站开发方案
  • 什么是建设网站的主题兼职做问卷调查的网站
  • 装饰网站建设软件下载公司旅游视频网站模板免费下载
  • aws网站建设个体户做网站去哪里做
  • 用四字成语做网站域名好吗宁波网站推广专业服务
  • 深圳网站建设公司是网络推广网上营销
  • 网站视频站建设教程和仿qq商城版淘宝客网站源码模板+带程序后台文章dede织梦企业程序
  • 温州红酒网站建设长沙移动网站建设
  • 如何制作网站?企业网站制作步骤
  • 桓台县旅游网站建设购物网站建设技术难点
  • 单页网站推广网站qq链接怎么做
  • wordpress仿站步骤平乡网站建设
  • 青岛高端网站建设公司新网站seo技术
  • 手机网站后台甘肃网络推广技巧
  • 做co网站阿里云建站方案
  • 如何做网站首页优化怎么查网站点击量
  • 北京网站制作百度推广潜江资讯网二手房出售
  • 北京建网站软件深圳企业网站
  • 网站关键词互点备案网站简介怎么写
  • 网站建设报告书范文哈尔滨网站公司哪家好
  • 景观毕业设计作品网站公司网站销售平台建设费分录
  • 品牌网站建设还来大蝌蚪华为手机WordPress
  • 东莞制作企业网站公司网站营销活动页面制作
  • 有中文网站 怎么做英文网站企业网站建设 价格
  • 网络游戏网站开发建设工程施工合同样本
  • 陕西网站制作公司泸州中泸集团建设有限公司网站