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

美食怎么做的小视频网站企业宣传网站在哪里做

美食怎么做的小视频网站,企业宣传网站在哪里做,快注销网站,山东网站定制设计公司在spring可以直接通过配置文件获取bean对象#xff0c;如果获取的bean对象还有若干设置#xff0c;需要自动完成#xff0c;可以通过工厂方法获取bean对象。 静态工厂类#xff0c;其中InterfaceUserDao和InterfaceUserService都是自定义的接口#xff0c;可以自己替换。…在spring可以直接通过配置文件获取bean对象如果获取的bean对象还有若干设置需要自动完成可以通过工厂方法获取bean对象。 静态工厂类其中InterfaceUserDao和InterfaceUserService都是自定义的接口可以自己替换。在这里就不贴出接口定义了。 package com.itheima.factory;import com.itheima.dao.interfaces.InterfaceUserDao; import com.itheima.dao.impl.UserDaoImpl; import com.itheima.service.interfaces.InterfaceUserService; import com.itheima.service.impl.UserServiceImpl;/*** copyright 2003-2024* author qiao wei* date 2024-12-24* version 1.0* brief 静态工厂方法返回Bean。该模式的特点是可以在返回Bean之前对Bean按需配置随后再返回。或者Bean不是由* 构造方法创建。* history name* date* brief*/ public class MyBeanFactory01 {/* ** author qiao wei* brief 无参静态方法。* param * return * throws * history name* date* brief*/public static InterfaceUserDao getUserDao010() {/*** 对返回的Bean做操作或配置。。。* 通过非构造方法创建。*/return new UserDaoImpl();}/* ** author qiao wei* brief 基础类型参数方法。* param * return * throws * history name* date* brief*/public static InterfaceUserService getUserService01(int paramValue) {return new UserServiceImpl();}/* ** author qiao wei* brief 多参数且含有引用类型参数方法。* param * return * throws * history name* date* brief*/public static InterfaceUserService getUserService012(int paramValue,InterfaceUserDao paramUserDao) {return new UserServiceImpl();} }配置xml文件 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:phttp://www.springframework.org/schema/pxmlns:contexthttp://www.springframework.org/schema/contextxmlns:aophttp://www.springframework.org/schema/aopxmlns:txhttp://www.springframework.org/schema/txxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-4.0.xsd!-- 引入外部资源。 --import resource../dao/userDaoImpl.xml/!--使用工厂的静态方法获取Bean实例。1Bean“myFactory001”的静态方法为无参方法。2Bean“myFactory002”的静态方法为有参方法参数分别为基本类型和引用类型。2.2Bean“userDaoRef”为被调用的引用类型类。--!--通过工厂的静态方法获取Bean对象InterfaceUserDao实例。1定义id。2class字段指定的类。3factory-method字段指定的getUserDao010方法该方法的返回值为Bean对象。--bean idmyFactory001classcom.itheima.factory.MyBeanFactory01factory-methodgetUserDao010/bean!--通过工厂的有参静态方法获取Bean对象InterfaceUserService实例。1Bean“myFactory002”的静态方法“getUserService012”是有参方法参数分别为基本类型int和引用类型UserDaoImpl类。--bean idmyFactory002classcom.itheima.factory.MyBeanFactory01factory-methodgetUserService012constructor-arg nameparamValuevalue100/constructor-arg!-- 从userDaoImpl.xml文件import类userDaoImpl001。 --constructor-arg nameparamUserDaorefuserDaoImpl001/constructor-arg/bean /beans 静态工厂方法注意事项 使用属性id定义bean。使用属性class指定类。使用属性factory-method指定静态方法。 通过id读取的bean为factory-methond的返回值。 方法myFactory001和myFactory002分别对应无参方法和有参方法。
http://www.pierceye.com/news/151325/

相关文章:

  • 仿腾讯视频网站源码个人制作网站工具
  • 泉州网站制作建设163注册企业邮箱
  • 漳州市建设局网站6热e国产-网站正在建设中-手机版
  • 给公司做网站数据分析江门网站设计制作
  • 怎么做新网站安宁网站建设熊掌号
  • com是什么网站网络科技公司可以去吗
  • 抖音创作者服务平台上海seo培训中心
  • 自己做网站app甘肃网站域名申请公司
  • 电子商务网站开发的课程介绍2023年新闻摘抄
  • 合肥如何做百度的网站推广百度知道官网首页登录入口
  • 织梦网站怎么做二级域名广州做网站费用
  • 湖南的商城网站建设网站建设与管理专业就业
  • 诸城企业网站建设wordpress经典编辑器插件
  • 做视频播放网站 赚钱全国建筑网站
  • 网站建站要多少钱2021安全员证报名入口
  • 成都建设网站那家好vs2019可以做网站吗
  • 个人网站开发教程济南高新网站制作
  • 中国空间站最新进展欧泰国际物流网站
  • 做淘宝链接网站成都网站建设 3e网络
  • 兰州中川国际机场t3航站楼vue单页面做网站加载慢
  • 公司网站制作费用申请泸州网站建设公司
  • 专业网络优化有名的seo外包公司
  • 宿迁网站建设制作湖南常德邮编
  • 网站制作方案电子商务网站建设与维护的主要内容
  • 网站淘宝客怎么做的建网站前途
  • 宁波网站开发服务网页制作技巧
  • 中医网站风格网络规划设计师2022论文5月
  • 网站主办者单位有效证件电子件是什么怎么做免费的产品网站
  • 设计素材网站好融资吗网站设计需要需要用
  • 北京品牌营销的服务机构sem和seo有什么区别