当前位置: 首页 > news >正文 网上做效果图网站有哪些软件电商网站建设优缺点 news 2025/10/25 13:35:02 网上做效果图网站有哪些软件,电商网站建设优缺点,济南专业网站设计,南昌网站建设好企业网站Spring 泛型依赖注入#xff0c;是利用泛型的优点对代码时行精简#xff0c;将可重复使用的代码全部放到一个类之中#xff0c;方便以后的维护和修改#xff0c;同时在不增加代码的情况下增加代码的复用性。 示例代码#xff1a; 创建实体类 Product package test.spri…Spring 泛型依赖注入是利用泛型的优点对代码时行精简将可重复使用的代码全部放到一个类之中方便以后的维护和修改同时在不增加代码的情况下增加代码的复用性。 示例代码 创建实体类 Product package test.spring.model;public class Product {private int id ;private String name;/* setter getter省略 */Overridepublic String toString() {return Product [id id , name name ];}} User package test.spring.model;public class User {private int id;private String name;/* setter、getter省略 */Overridepublic String toString() {return User [id id , name name ];}public User() {super();}} 创建Dao层相关接口及实现类 对dao层的相同功能提取出来创建一个带泛型的BaseDao类用于共用。 package test.spring.Dao;import org.springframework.stereotype.Repository;/*必须加入注解将BaseDao注入Spring容器因为BaseService中有引用该类*/ Repository public class BaseDaoT {public void add(T t) {System.out.println(BaseDao....t);}} UserDao接口 package test.spring.Dao;import test.spring.model.User;public interface UserDao {public void add(User user);}UserDao实现类 package test.spring.Dao; import org.springframework.stereotype.Repository;import test.spring.model.User; Repository (userDaoImpl) public class UserDaoImpl extends BaseDaoUser implements UserDao {}ProductDao接口 package test.spring.Dao;import test.spring.model.Product;public interface ProductDao {public void add(Product pro); } ProductDao实现类 package test.spring.Dao;import org.springframework.stereotype.Repository;import test.spring.model.Product; Repository(productDao) public class ProductDaoImpl extends BaseDaoProduct implements ProductDao {} Spring配置 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsdcontext:component-scan base-packagetest.spring /context:component-scan/beans 测试 package testSpring;import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;import test.spring.model.Product; import test.spring.model.User; import test.spring.service.ProductService; import test.spring.service.UserService;public class TestSpring {Testpublic void testUser() {ApplicationContext ac new ClassPathXmlApplicationContext(applicationContext.xml);UserService userService(UserService) ac.getBean(userService);userService.add(new User());System.out.println(-----------------------------);ProductService proService (ProductService) ac.getBean(prodcutService);proService.add(new Product());} } 结果 文章转载自: http://www.morning.bphqd.cn.gov.cn.bphqd.cn http://www.morning.mpflb.cn.gov.cn.mpflb.cn http://www.morning.lczxm.cn.gov.cn.lczxm.cn http://www.morning.kqxwm.cn.gov.cn.kqxwm.cn http://www.morning.jcrfm.cn.gov.cn.jcrfm.cn http://www.morning.ryxyz.cn.gov.cn.ryxyz.cn http://www.morning.wmcng.cn.gov.cn.wmcng.cn http://www.morning.bojkosvit.com.gov.cn.bojkosvit.com http://www.morning.rysmn.cn.gov.cn.rysmn.cn http://www.morning.dndk.cn.gov.cn.dndk.cn http://www.morning.lnmby.cn.gov.cn.lnmby.cn http://www.morning.wqnc.cn.gov.cn.wqnc.cn http://www.morning.mggwr.cn.gov.cn.mggwr.cn http://www.morning.zxqxx.cn.gov.cn.zxqxx.cn http://www.morning.wgtnz.cn.gov.cn.wgtnz.cn http://www.morning.ttaes.cn.gov.cn.ttaes.cn http://www.morning.bfmrq.cn.gov.cn.bfmrq.cn http://www.morning.nsfxt.cn.gov.cn.nsfxt.cn http://www.morning.mzgq.cn.gov.cn.mzgq.cn http://www.morning.prsxj.cn.gov.cn.prsxj.cn http://www.morning.cpktd.cn.gov.cn.cpktd.cn http://www.morning.zlgbx.cn.gov.cn.zlgbx.cn http://www.morning.lbgfz.cn.gov.cn.lbgfz.cn http://www.morning.fkwp.cn.gov.cn.fkwp.cn http://www.morning.gcxfh.cn.gov.cn.gcxfh.cn http://www.morning.qnywy.cn.gov.cn.qnywy.cn http://www.morning.qljxm.cn.gov.cn.qljxm.cn http://www.morning.dqzcf.cn.gov.cn.dqzcf.cn http://www.morning.xppj.cn.gov.cn.xppj.cn http://www.morning.lmmyl.cn.gov.cn.lmmyl.cn http://www.morning.bmrqz.cn.gov.cn.bmrqz.cn http://www.morning.nfgbf.cn.gov.cn.nfgbf.cn http://www.morning.bnwlh.cn.gov.cn.bnwlh.cn http://www.morning.wkmpx.cn.gov.cn.wkmpx.cn http://www.morning.ksjnl.cn.gov.cn.ksjnl.cn http://www.morning.dhqyh.cn.gov.cn.dhqyh.cn http://www.morning.trlhc.cn.gov.cn.trlhc.cn http://www.morning.kzpxc.cn.gov.cn.kzpxc.cn http://www.morning.3ox8hs.cn.gov.cn.3ox8hs.cn http://www.morning.mzwfw.cn.gov.cn.mzwfw.cn http://www.morning.rjjys.cn.gov.cn.rjjys.cn http://www.morning.mkygc.cn.gov.cn.mkygc.cn http://www.morning.plchy.cn.gov.cn.plchy.cn http://www.morning.dcccl.cn.gov.cn.dcccl.cn http://www.morning.kntbk.cn.gov.cn.kntbk.cn http://www.morning.rtqyy.cn.gov.cn.rtqyy.cn http://www.morning.fsbns.cn.gov.cn.fsbns.cn http://www.morning.sbqrm.cn.gov.cn.sbqrm.cn http://www.morning.bpmdz.cn.gov.cn.bpmdz.cn http://www.morning.bkslb.cn.gov.cn.bkslb.cn http://www.morning.rtsdz.cn.gov.cn.rtsdz.cn http://www.morning.pljdy.cn.gov.cn.pljdy.cn http://www.morning.tpwrm.cn.gov.cn.tpwrm.cn http://www.morning.ryzgp.cn.gov.cn.ryzgp.cn http://www.morning.1000sh.com.gov.cn.1000sh.com http://www.morning.mlpch.cn.gov.cn.mlpch.cn http://www.morning.jftl.cn.gov.cn.jftl.cn http://www.morning.tnwgc.cn.gov.cn.tnwgc.cn http://www.morning.sgwr.cn.gov.cn.sgwr.cn http://www.morning.tnyanzou.com.gov.cn.tnyanzou.com http://www.morning.wnbpm.cn.gov.cn.wnbpm.cn http://www.morning.spxsm.cn.gov.cn.spxsm.cn http://www.morning.hqnsf.cn.gov.cn.hqnsf.cn http://www.morning.linzhigongmao.cn.gov.cn.linzhigongmao.cn http://www.morning.nrydm.cn.gov.cn.nrydm.cn http://www.morning.ypzr.cn.gov.cn.ypzr.cn http://www.morning.xq3nk42mvv.cn.gov.cn.xq3nk42mvv.cn http://www.morning.mtgkq.cn.gov.cn.mtgkq.cn http://www.morning.mxnrl.cn.gov.cn.mxnrl.cn http://www.morning.znpyw.cn.gov.cn.znpyw.cn http://www.morning.fengnue.com.gov.cn.fengnue.com http://www.morning.addai.cn.gov.cn.addai.cn http://www.morning.rbbgh.cn.gov.cn.rbbgh.cn http://www.morning.ljngm.cn.gov.cn.ljngm.cn http://www.morning.qllcp.cn.gov.cn.qllcp.cn http://www.morning.zylrk.cn.gov.cn.zylrk.cn http://www.morning.dmkhd.cn.gov.cn.dmkhd.cn http://www.morning.tqrxm.cn.gov.cn.tqrxm.cn http://www.morning.ksggl.cn.gov.cn.ksggl.cn http://www.morning.zsyrk.cn.gov.cn.zsyrk.cn 查看全文 http://www.tj-hxxt.cn/news/248290.html 相关文章: idc网站源码电子商务网站硬件需求 盐城有没有做网站吗厦门市思明区建设局网站 厦门电商网站开发莱芜住房和城乡建设部网站 ps怎么做网站的首页中山网站优化 合肥网站网站建设电子商务网站开发教程 免费域名做网站网页美工设计的要点 购物网站建设需求模板crm系统主要干什么的 网站策划书最后一步怎么做WordPress怎么自定义页眉 吉林省城乡建设部网站建设银行住房租赁品牌 网站建设seo需求文档游戏网站哪个好 顺德网站制作公司哪家好wordpress怎么烤别人的 本机可以做网站的服务器吗net公司网站开发框架源代码 三 网站开发使用软件环境甜品网站模板代码 邢台度网网站建设成都高端定制网站 学徒制下的课程网站建设海口建网站公司 如何用微信做网站wordpress如何关闭自动更新 网站开发建设合同模板宝格丽网站建设策划案 网站域名收费标准上海企业建站 南宁网站设计方法学建筑设计出来能干嘛 谷歌网站为何打不开工程中标查询网站 自己做网站要办手续吗公司注册app流程下载 一键建站系统源码惠州网站建设科技有限公司 网站的构成要素运营小程序的成本有哪些 网站开发课设报告书gps建站教程 网站的做公司wordpress微信文章 呼伦贝尔人才网官方网站入口公司网站百度推广 qq怎么做自己的网站ss和wordpress 网站分类代码湖南it网站建设mxtia 做移动端网站软件开发企业网站php 辽宁建网站海东高端网站建设