dubbo-helloword(二)
项目框架搭建
工程目录创建
entity存放业务实体类
interface存放server接口
concumer是服务消费者(依赖interface和entity)
provider是服务提供者(依赖interface和entity)
concumer和provider是web工程,准备用tomcat容器托管
引入pom依赖
1.master pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.liqiang</groupId> <artifactId>dubbo-helloword-master</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <junit.version>3.8.1</junit.version> <springframework.version>4.1.6.RELEASE</springframework.version> <commonsLogging.version>1.2</commonsLogging.version> </properties> <modules> <module>dubbo-helloword-provider</module> <module>dubbo-helloword-consumer</module> <module>dubbo-helloword-interface</module> <module>dubbo-helloword-entity</module> </modules> </project>
2.provider pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>dubbo-helloword-master</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>dubbo-helloword-provider</artifactId> <packaging>war</packaging> <name>dubbo-helloword-provider Maven Webapp</name> <!-- FIXME change it to the project's website --> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <!-- **************************** Spring 依赖 **************************** --> <!-- 添加Spring-core包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${springframework.version}</version> </dependency> <!--springMVC依赖--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${springframework.version}</version> <type>jar</type> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${springframework.version}</version> </dependency> <!-- 添加spring-tx包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${springframework.version}</version> </dependency> <!-- Spring ORM 相关--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${springframework.version}</version> </dependency> <!-- 添加spring-jdbc包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${springframework.version}</version> </dependency> <!--添加spring-web包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${springframework.version}</version> </dependency> <!-- 添加spring-context包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>${commonsLogging.version}</version> </dependency> <!--添加aspectjweaver包 --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.5</version> </dependency> <!-- **************************** /Spring 依赖 **************************** --> <!-- log4j --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.6</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.6</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version> </dependency> <!-- **************************** Dubbo 依赖 **************************** --> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</artifactId> <version>2.5.3</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>3.3.3</version> <exclusions> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> <version>0.1</version> </dependency> <!-- **************************** /Dubbo 依赖 **************************** --> <!-- **************************** entity 依赖 **************************** --> <dependency> <artifactId>dubbo-helloword-entity</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </dependency> <!-- **************************** /entity 依赖 **************************** --> <!-- **************************** interface 依赖 **************************** --> <dependency> <artifactId>dubbo-helloword-interface</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </dependency> <!-- **************************** /interface 依赖 **************************** --> </dependencies> </project>
3.consumer pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>dubbo-helloword-master</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>dubbo-helloword-consumer</artifactId> <packaging>war</packaging> <name>dubbo-helloword-consumer Maven Webapp</name> <!-- FIXME change it to the project's website --> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <!-- **************************** Spring 依赖 **************************** --> <!-- 添加Spring-core包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${springframework.version}</version> </dependency> <!--springMVC依赖--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${springframework.version}</version> <type>jar</type> </dependency> <!-- 添加spring-tx包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${springframework.version}</version> </dependency> <!-- Spring ORM 相关--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${springframework.version}</version> </dependency> <!-- 添加spring-jdbc包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${springframework.version}</version> </dependency> <!--添加spring-web包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${springframework.version}</version> </dependency> <!-- 添加spring-context包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>${commonsLogging.version}</version> </dependency> <!--添加aspectjweaver包 --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.5</version> </dependency> <!-- **************************** /Spring 依赖 **************************** --> <!-- log4j --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.6</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.6</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version> </dependency> <!-- json序列化--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.7.1</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.13</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.13</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.7.1</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.7.1-1</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.7.1-1</version> </dependency> <!-- **************************** Dubbo 依赖 **************************** --> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</artifactId> <version>2.5.3</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>3.3.3</version> <exclusions> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> <version>0.1</version> </dependency> <!-- **************************** /Dubbo 依赖 **************************** --> <!-- **************************** entity 依赖 **************************** --> <dependency> <artifactId>dubbo-helloword-entity</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </dependency> <!-- **************************** /entity 依赖 **************************** --> <!-- **************************** interface 依赖 **************************** --> <dependency> <artifactId>dubbo-helloword-interface</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </dependency> <!-- **************************** /interface 依赖 **************************** --> </dependencies> </project>
3.interface pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>dubbo-helloword-master</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>dubbo-helloword-interface</artifactId> <dependencies> <!-- **************************** entity 依赖 **************************** --> <dependency> <artifactId>dubbo-helloword-entity</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </dependency> <!-- **************************** /entity 依赖 **************************** --> </dependencies> </project>
4.entity pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>dubbo-helloword-master</artifactId> <groupId>com.liqiang</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>dubbo-helloword-entity</artifactId> </project>
刷新
5.proverder web.xml增加监听器启动spring容器
<web-app> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-*.xml</param-value> </context-param> <!--配置监听器初始化spring容器--> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app>
6.consumer web.xml新增springmvc 的servlet。
<web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>dispatcherServlet</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:spring-*.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>
发布服务和订阅服务
1.entity创建1个实体类
public class UserEntity implements Serializable { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
2.interface 创建服务接口
public interface UserService { public List<UserEntity> findAll(); }
3.provider发布服务
新增服务实现类
@Service public class UserServiceImpl implements UserService { @Override public List<UserEntity> findAll() { List<UserEntity> userEntitys=new ArrayList<UserEntity>(); UserEntity userEntity=null; //模拟db查询数据 for(int i=0;i<=10;i++){ userEntity=new UserEntity(); userEntity.setName("小明"+i); userEntity.setAge(i+1); userEntitys.add(userEntity); } return userEntitys; } }
增加spring-dubbo.xml和log4j.properties
<!--添加dubbo schema--> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!--开启注解扫描--> <context:component-scan base-package="com.liqiang.service.impl"></context:component-scan> <!-- 提供方应用信息,用于计算依赖关系 --> <dubbo:application name="userSystemProvider" /> <!-- 服务注册中心地址 其他参数请看用户指南--> <dubbo:registry address="zookeeper://192.168.65.128:2181?backup=192.168.65.128:2182,192.168.65.128:2183" /> <dubbo:provider delay="-1" timeout="6000" retries="0"/> <!-- 用dubbo协议在20880端口暴露服务 --> <dubbo:protocol name="dubbo" port="20880" /> <!--发布服务--> <dubbo:service interface="com.liqiang.service.UserService" ref="userServiceImpl"></dubbo:service> </beans>
# Control logging for other open source packages #这两句是把这两个包下出现的错误的等级设为ERROR,如果项目中没有配置EHCache,则不需要这两句。 log4j.logger.com.opensymphony.oscache=ERROR log4j.logger.net.sf.navigator=ERROR log4j.logger.net.sf.acegisecurity=WARN log4j.logger.net.sf.acegisecurity.intercept.event.LoggerListener=WARN log4j.logger.org.displaytag=ERROR log4j.logger.org.springframework=WARN # Don't show debug logs for WebTest log4j.logger.com.canoo.webtest=WARN # All hibernate log output of "info" level or higher goes to stdout. # For more verbose logging, change the "info" to "debug" on the last line. log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN log4j.logger.org.hibernate=WARN # Changing the log level to DEBUG will result in Hibernate generated # SQL to be logged. log4j.logger.org.hibernate.SQL=ERROR # Changing the log level to DEBUG will result in the PreparedStatement # bound variable values to be logged. log4j.logger.org.hibernate.type=ERROR log4j.logger.org.springframework.web.servlet.handler.SimpleMappingExceptionResolver=WARN log4j.rootLogger=info,A1,R log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.Target=System.out log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=[%c]%m%n log4j.appender.R=org.apache.log4j.DailyRollingFileAppender log4j.appender.R.File=../logs/log_.txt log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.Append = true log4j.appender.R.ImmediateFlush = true log4j.appender.R.DatePattern = '.' yyyy - MM - dd '.txt' log4j.appender.R.layout.ConversionPattern=[%p][%d{yyyy-MM-dd HH\:mm\:ss,SSS}][%c]%m%n log4j.logger.com.biz.eisp.api = DEBUG
consumer订阅服务
新增spring-dubbo.xml以及log4配置(与前面想同)
<!--添加dubbo schema--> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!--开启注解扫描--> <context:component-scan base-package="com.liqiang.contorller"></context:component-scan> <mvc:annotation-driven/> <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 --> <dubbo:application name="userSystem" /> <!-- 服务注册中心地址 其他参数请看用户指南--> <dubbo:registry address="zookeeper://192.168.65.128:2181?backup=192.168.65.128:2182,192.168.65.128:2183" /> <!--订阅服务--> <dubbo:reference interface="com.liqiang.service.UserService" id="userServiceImpl"></dubbo:reference> </beans>
使用服务
@Controller public class UserContorller implements BeanNameAware { @Autowired UserService userService; @RequestMapping(value = "/user", method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) @ResponseBody public List<UserEntity> findAll() { List<UserEntity> userEntities= userService.findAll(); return userEntities; } @Override public void setBeanName(String s) { System.out.println("初始化了"); } }
测试
配置provider和consumer tomcat启动
2个端口改为不一致 provider配置一样
先启动 provider 再启动concumer
dubboadmin 查看服务状态以及对服务治理
消费者调用服务
建议
这是一个简单的demo。dubbo发布服务 以及xml配置还有许多 建议刷一遍用户指南 知道哪些配置有什么效果,根据不同的需求进行不同配置才能达到熟练使用
https://dubbo.gitbooks.io/dubbo-user-book/content/configuration/xml.html
dubbo-helloword(二)的更多相关文章
- dubbo漫谈二
转:腾信视频 阿甘 https://ke.qq.com/course/216518 https://blog.csdn.net/u013142781/article/details/50396621 ...
- Dubbo helloword
首先,开始编写服务提供者的api接口, SampleService 接口 package bhz.dubbo.sample.provider; import java.util.List; publ ...
- dubbo系列二、dubbo+zookeeper+dubboadmin分布式服务框架搭建(windows平台)
一.zookeeper配置中心安装 1.下载安装包,zookeeper-3.4.6.tar.gz 2.解压安装包,修改配置文件 参考zookeeper-3.4.6/conf/zoo_sample.cf ...
- Dubbo学习(二) Dubbo 集群容错模式-负载均衡模式
Dubbo是Alibaba开源的分布式服务框架,我们可以非常容易地通过Dubbo来构建分布式服务,并根据自己实际业务应用场景来选择合适的集群容错模式,这个对于很多应用都是迫切希望的,只需要通过简单的配 ...
- Dubbo(二) -- Simple Monitor
一.简介 dubbo-monitor-simple是dubbo提供的简单监控中心,可以用来显示接口暴露,注册情况,也可以看接口的调用明细,调用时间等. Simple Monitor挂掉不会影响到Con ...
- Dubbo(二):深入理解Dubbo的服务发现SPI机制
一.前言 用到微服务就不得不来谈谈服务发现的话题.通俗的来说,就是在提供服务方把服务注册到注册中心,并且告诉服务消费方现在已经存在了这个服务.那么里面的细节到底是怎么通过代码实现的呢,现在我们来看看D ...
- Dubbo+Zookeeper(二)Dubbo架构
上次更新博客已经是一年前,这一年发生了很多事,并不顺利,甚至有些痛苦,不过不管怎样,不要停止学习,只有学习才能让你变强,应对更多不安定. 一.RPC概念 Dubbo服务是一个RPC框架,那我们首先就要 ...
- Dubbo(二) 认识Zookeeper
前言 在昨天,我们给大家基本介绍了Dubbo,文中反复提到了Zookeeper,那么它到底是什么呢,这篇文章我们将从Dubbo层面去了解Zookeeper,不做全面讲解,毕竟这是Dubbo教程啊~ Z ...
- dubbo系列二:dubbo常用功能总结
准备工作: (1)启动zookeeper作为dubbo的注册中心 (2)新建一个maven的生产者web工程dubbo-provider-web和一个maven的消费者web工程dubbo-consu ...
- dubbo学习 二 dubbo源码大致查阅
源码的解析在官网都已经写的非常详细,可以参考:http://dubbo.io/Developer+Guide-zh.htm 服务提供者暴露一个服务的详细过程 首先ServiceConfig类拿到对 ...
随机推荐
- luogu2154 [SDOI2009] 虔诚的墓主人 离散化 树状数组 扫描线
题目大意 公墓可以看成一块N×M的矩形,矩形的每个格点,要么种着一棵常青树,要么是一块还没有归属的墓地.一块墓地的虔诚度是指以这块墓地为中心的十字架的数目,一个十字架可以看成中间是墓地,墓地的正上.正 ...
- SQL2000数据库定期自动备份与修改
SQL2000数据库定期自动备份与修改 http://www.veryhuo.com 2009-11-19 烈火网 投递稿件 我有话说 在SQL server企业管理器中,可以设置数据库的定期自动 ...
- B1231 [Usaco2008 Nov]mixup2 混乱的奶牛 状压dp
发现是状压dp,但是还是不会...之前都白学了,本蒟蒻怎么这么菜,怎么都学不会啊... 其实我位运算基础太差了,所以状压学的不好. 题干: Description 混乱的奶牛 [Don Piele, ...
- PCB MS SQL SERVER版本管控工具source_safe_for_sql_server
PCB由于业务关系复杂,业务触发一个事件时,可能需与数据库多个表进行关连处理才能拿到数据结果, 而表关连并不是简单的关连,实际是要进行大量数据筛选,逻辑判断,转换等过程...这个过程是复杂的 想一想, ...
- 深入理解Redis(一)——高级键管理与数据结构
引语 这个章节主要讲解了三部分内容: 如何设计并管理Redis的键以及与其关联的数据结构: 了解并使用Redis客户端对象映射器: 介绍如何利用大O标记来评估Redis性能. 键与数据结构 键 我们先 ...
- JQuery 兼容所有浏览器的复制到剪切板功能
灵机一动想的点子,应该不难理解 <textarea onmousedown='selectAll(this);'>11111</textarea> function selec ...
- bcg库使用心得两则
作者:朱金灿 来源:http://blog.csdn.net/clever101 最近帮同事解决了两个BCG库的使用问题,特记录下来. 一是在outlook风格停靠栏上创建对话框的做法.代码如下: C ...
- Windows下错误码全解析
windows系统下,调用函数出错时.可以调用GetLastError函数返回错误码.但是GetLastError函数返回值是DWORD类型,是一个整数.如果想要知道函数调用的真正错误原因,就需要对这 ...
- OC对象的本质及分类
Object-C的底层都是通过C/C++来实现的,所以OC中的对象也会转化成C/C++中的某一个数据结构, 我们在终端里通过指令 xcrun -sdk iphoneos clang -arch arm ...
- NOPI读取Word模板并保存
安装NPOI 可以在 程序包管理器控制台中输入 PM> Install-Package NPOI 会下载最新版本NPOI ----------------------------引用了NPOI- ...