sprig-boot是一个微服务架构,加快了spring工程快速开发,以及简便了配置。接下来开始spring-boot与mybatis的整合。

1、创建一个maven工程命名为spring-boot-entity,pom.xml文件配置如下:

<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.spring.boot.entity</groupId>
<artifactId>spring-boot-entity</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>

<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<!-- 其中distributionManagement节点配置的仓库为当前工程打包时发布的仓库 -->
</project>

然后创建一个包,命名为com.spring.boot.entity,在该包下创建一个User.java文件,内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月11日 下午2:34:32
* @since V1.0.0
*/
package com.spring.boot.entity;

/**
* TODO
*
* @author liyj
* @date 2017年7月11日 下午2:34:32
*
*/
public class UserEntity {
/**
* id
*/
private String id;
/**
* name
*/
private String name;
/**
* pass
*/
private String pass;
/**
* email
*/
private String email;
/**
* iphone
*/
private String iphone;
public UserEntity() {}
public UserEntity(String id) {this.id = id;}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getIphone() {
return iphone;
}
public void setIphone(String iphone) {
this.iphone = iphone;
}

}

到此,spring-boot-entity工程创建完成。

2、创建一个maven工程,命名为spring-boot-interface,pom.xml文件配置如下:

<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.spring.boot.inter</groupId>
<artifactId>spring-boot-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>

<!-- 引入spring-boo-entity工程打成的jar包 -->
<dependency>
<groupId>com.spring.boot.entity</groupId>
<artifactId>spring-boot-entity</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<!-- 其中distributionManagement节点配置的仓库为当前工程打包时发布的仓库 -->
</project>

然后创建一个包,命名为com.spring.boot.inter.service,在该包下创建UserService.java接口类。内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月11日 下午2:31:20
* @since V1.0.0
*/
package com.spring.boot.inter.service;

import java.util.List;
import com.spring.boot.entity.UserEntity;

/**
* TODO
*
* @author liyj
* @date 2017年7月11日 下午2:31:20
*
*/
public interface UserService {

/*
* insert
*/
void insert(UserEntity entity);

/*
* deleteEntity
*/
void deleteEntity(UserEntity entity);

/*
* deleteById
*/
void deleteById(String id);

/*
* updateEntity
*/
void updateEntity(UserEntity entity);

/*
* updateById
*/
void updateById(String id);

/*
* getOne
*/
UserEntity getOne(String id);

/*
* getList
*/
List<UserEntity> getList();
}

到此,spring-boot-interface工程完成。

3、创建一个maven工程,命名为spring-boot-main,pom.xml文件内容如下:

<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.spring.boot.service</groupId>
<artifactId>spring-boot-service</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
<!-- entity、接口的jar包 -->
<dependency>
<groupId>com.spring.boot.entity</groupId>
<artifactId>spring-boot-entity</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.spring.boot.inter</groupId>
<artifactId>spring-boot-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.1.RELEASE</version> </dependency> -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.3.1.RELEASE</version>
</dependency>
<!-- end -->

<!-- mybatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.6</version>
</dependency>
<!-- <dependency> <groupId>org.apache.ibatis</groupId> <artifactId>ibatis-sqlmap</artifactId>
<version>2.3.0</version> </dependency> -->
<!-- <dependency> <groupId>org.apache.ibatis</groupId> <artifactId>ibatis-core</artifactId>
<version>3.0</version> </dependency> -->
<!-- end -->

<!-- 配置mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
<!-- end -->

<!-- 配置C3P0数据源 -->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.2.1</version>
</dependency>
<!-- end -->

<!--util -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>

<!-- 添加缓存支持 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>

<!-- 使用ehcache缓存方案 -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.9.0</version>
</dependency>
<!-- redis缓存 -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.2</version>
</dependency>
<!-- springboot整合 redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
</dependencies>

<!-- 打包成一个可执行的jar包 -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.1.RELEASE</version>
</plugin>
</plugins>
</build>

<!-- 项目发布仓库 -->
<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

</project>

然后创建包,命名为com.spring.boot.base,在该包下创建DataBaseConfig.java文件,文件内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月12日 上午9:53:09
* @since V1.0.0
*/
package com.spring.boot.base;

import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.mchange.v2.c3p0.ComboPooledDataSource;

/**
* TODO
*
* @author liyj
* @date 2017年7月12日 上午9:53:09
*
*/
@Configuration
@EnableTransactionManagement
public class DataBaseConfig {

private final Logger log = LoggerFactory.getLogger(DataBaseConfig.class);

@Bean
@Primary
public DataSource getDataSource() throws Exception {
log.debug("config dataSource");
ComboPooledDataSource cpds = new ComboPooledDataSource();
cpds.setDriverClass("com.mysql.jdbc.Driver");
cpds.setJdbcUrl("jdbc:mysql://localhost:3306/springboot");
cpds.setUser("root");
cpds.setPassword("root");
return cpds;
}

@Bean
public PlatformTransactionManager getTransactionManager() throws Exception {
return new DataSourceTransactionManager(getDataSource());
}

@Bean
public SqlSessionFactory getSqlSessionFactory() throws Exception {
SqlSessionFactoryBean sfb = new SqlSessionFactoryBean();
sfb.setDataSource(getDataSource());
sfb.setTypeAliasesPackage("com.spring.boot.entity");
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
sfb.setMapperLocations(resolver
.getResources("classpath:/mapper/*.xml"));
return sfb.getObject();
}

@Bean
public MapperScannerConfigurer getMapperScannerConfigurer() {
MapperScannerConfigurer msc = new MapperScannerConfigurer();
msc.setBasePackage("com.mybloc.personal.mapper");
msc.setSqlSessionFactoryBeanName("sqlSessionFactory");
return msc;
}
}

创建一个包,命名为com.spring.boot.dao,在该包下创建UserMapper.java文件,该文件是一个接口类,内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月11日 下午6:24:35
* @since V1.0.0
*/
package com.spring.boot.dao;

import java.util.List;
import com.spring.boot.entity.UserEntity;

/**
* TODO
*
* @author liyj
* @date 2017年7月11日 下午6:24:35
*
*/
public interface UserMapper {

public void insertOne(UserEntity entity);

public void delete(UserEntity entity);

public void update(UserEntity entity);

public UserEntity getOne(UserEntity entity);

public List<UserEntity> getList();
}

在src/main/resources目录下创建一个mapper文件目录,在该目录下创建UserMapper.xml文件,内容如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.spring.boot.dao.UserMapper">
<!-- 增 -->
<insert id="insertOne" parameterType="UserEntity">
insert into user(id,name,pass,email,iphone)
values(#{id},#{name},#{pass},#{email},#{iphone})
</insert>

<!-- 删 -->
<delete id="delete" parameterType="UserEntity">
delete from user where id = #{id}
</delete>

<!-- 改 -->
<update id="update" parameterType="UserEntity">
update user set email = #{email},iphone = #{iphone} where id = #{id}
</update>

<!-- 查 -->
<select id="getOne" parameterType="UserEntity" resultType="UserEntity">
select id,
name,
pass,
email,
iphone
from user
where id = #{id}
</select>

<!-- 查集合 -->
<select id="getList" resultType="UserEntity">
select id,
name,
pass,
email,
iphone
from user
</select>
</mapper>

接下来创建包,命名为:com.spring.boot.service,在该包下创建UserServiceImpl.java文件,内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月11日 下午4:18:55
* @since V1.0.0
*/
package com.spring.boot.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.spring.boot.dao.UserMapper;
import com.spring.boot.entity.UserEntity;
import com.spring.boot.inter.service.UserService;

/**
* TODO
*
* @author liyj
* @date 2017年7月11日 下午4:18:55
*
*/
@Transactional(readOnly=false)
@Service
public class UserServiceImpl implements UserService {

@Autowired
private UserMapper userMapper;

/*
* @see com.spring.boot.inter.service.UserService#insert(com.spring.boot.entity.UserEntity)
*/
public void insert(UserEntity entity) {
userMapper.insertOne(entity);
System.out.println("insert");
}

/*
* @see com.spring.boot.inter.service.UserService#deleteEntity(com.spring.boot.entity.UserEntity)
*/
public void deleteEntity(UserEntity entity) {
userMapper.delete(entity);
System.out.println("deleteEntity");
}

/*
* @see com.spring.boot.inter.service.UserService#deleteById(java.lang.String)
*/
public void deleteById(String id) {
userMapper.delete(new UserEntity(id));
System.out.println("deleteById");
}

/*
* @see com.spring.boot.inter.service.UserService#updateEntity(com.spring.boot.entity.UserEntity)
*/
public void updateEntity(UserEntity entity) {
userMapper.update(entity);
System.out.println("updateEntity");
}

/*
* @see com.spring.boot.inter.service.UserService#updateById(java.lang.String)
*/
public void updateById(String id) {
userMapper.update(new UserEntity(id));
System.out.println("updateById");
}

/*
* @see com.spring.boot.inter.service.UserService#getOne(java.lang.String)
*/
@Transactional(readOnly=true)
public UserEntity getOne(String id) {
return userMapper.getOne(new UserEntity(id));
}

/*
* @see com.spring.boot.inter.service.UserService#getList()
*/
@Transactional(readOnly=true)
public List<UserEntity> getList() {
return userMapper.getList();
}
}

再创建一个包,命名为com.spring.boot.controller,在该包下创建UserController.java文件,内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月11日 下午6:08:00
* @since V1.0.0
*/
package com.spring.boot.controller;

import java.util.Collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.spring.boot.entity.UserEntity;
import com.spring.boot.inter.service.UserService;

/**
* TODO
*
* @author liyj
* @date 2017年7月11日 下午6:08:00
*
*/
//@SpringBootApplication(scanBasePackages = {"com.spring.boot"})
@RestController
@RequestMapping("/user")
public class UserController {

@Autowired
private UserService userService;
@Autowired
private CacheManager cacheManager;
@Autowired
private RedisTemplate<String,String> redisTemplate;

@Value("${testName}")
private String name;
@Value("${testPass}")
private String pass;

@RequestMapping(value = "/say", method = RequestMethod.GET)
public String sayHello() {
return "hello spring boot";
}

@RequestMapping(value = "/insert", method = RequestMethod.GET)
public String insert() {
UserEntity userEntity = new UserEntity();
userEntity.setId("111");
userEntity.setName("liyj");
userEntity.setPass("123456");
userEntity.setEmail("704603154@qq.com");
userEntity.setIphone("18211140412");
userService.insert(userEntity);
return "success";
}

@RequestMapping(value = "/one/get", method = RequestMethod.GET)
public UserEntity getOne(@RequestParam String id) {
return userService.getOne(id);
}
}

接着创建一个包,命名为com.spring.boot.start,在该包下创建StartMain.java文件,内容如下:

/**
* Copyright (c) Windliven 2016 All Rights Reserved
*
* @author liyj
* @date 2017年7月11日 下午4:52:32
* @since V1.0.0
*/
package com.spring.boot.start;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
* TODO
*
* @author liyj
* @date 2017年7月11日 下午4:52:32
*
*/
@EnableAutoConfiguration
@ComponentScan(basePackages = "com.spring.boot")
@Configuration
@MapperScan(value={"com.spring.boot.dao"})
public class StartMain {

public static void main(String[] args) {
SpringApplication.run(StartMain.class, args);
}
}

最后测试,启动StartMain类中的main()方法,项目便启动了,可以正常的从浏览器中访问和测试。

spring-boot整合mybatis(1)的更多相关文章

  1. Spring Boot整合Mybatis并完成CRUD操作

    MyBatis 是一款优秀的持久层框架,被各大互联网公司使用,本文使用Spring Boot整合Mybatis,并完成CRUD操作. 为什么要使用Mybatis?我们需要掌握Mybatis吗? 说的官 ...

  2. spring boot 整合 mybatis 以及原理

    同上一篇文章一样,spring boot 整合 mybatis过程中没有看见SqlSessionFactory,sqlsession(sqlsessionTemplate),就连在spring框架整合 ...

  3. Spring Boot 整合mybatis时遇到的mapper接口不能注入的问题

    现实情况是这样的,因为在练习spring boot整合mybatis,所以自己新建了个项目做测试,可是在idea里面mapper接口注入报错,后来百度查询了下,把idea的注入等级设置为了warnin ...

  4. Spring Boot整合Mybatis报错InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider

    Spring Boot整合Mybatis时一直报错 后来发现原来主配置类上的MapperScan导错了包 由于我使用了通用Mapper,所以应该导入通用mapper这个包

  5. Spring Boot整合MyBatis(非注解版)

    Spring Boot整合MyBatis(非注解版),开发时采用的时IDEA,JDK1.8 直接上图: 文件夹不存在,创建一个新的路径文件夹 创建完成目录结构如下: 本人第一步习惯先把需要的包结构创建 ...

  6. Spring Boot整合Mybatis完成级联一对多CRUD操作

    在关系型数据库中,随处可见表之间的连接,对级联的表进行增删改查也是程序员必备的基础技能.关于Spring Boot整合Mybatis在之前已经详细写过,不熟悉的可以回顾Spring Boot整合Myb ...

  7. Spring Boot系列(三):Spring Boot整合Mybatis源码解析

    一.Mybatis回顾 1.MyBatis介绍 Mybatis是一个半ORM框架,它使用简单的 XML 或注解用于配置和原始映射,将接口和Java的POJOs(普通的Java 对象)映射成数据库中的记 ...

  8. 太妙了!Spring boot 整合 Mybatis Druid,还能配置监控?

    Spring boot 整合 Mybatis Druid并配置监控 添加依赖 <!--druid--> <dependency> <groupId>com.alib ...

  9. Spring Boot 整合 Mybatis 实现 Druid 多数据源详解

    摘要: 原创出处:www.bysocket.com 泥瓦匠BYSocket 希望转载,保留摘要,谢谢! “清醒时做事,糊涂时跑步,大怒时睡觉,独处时思考” 本文提纲一.多数据源的应用场景二.运行 sp ...

  10. Spring boot整合Mybatis

    时隔两个月的再来写博客的感觉怎么样呢,只能用“棒”来形容了.闲话少说,直接入正题,之前的博客中有说过,将spring与mybatis整个后开发会更爽,基于现在springboot已经成为整个业界开发主 ...

随机推荐

  1. RSA加密通信小结(四)--RSA加解密的实际操作与流程小结

    在上一篇文章中,我们已经将密钥的生成方法和流程,归纳总结.而本篇主要是讲如何利用密钥进行加解密. 首先,在上一篇文章中的我们生成了很多密钥,证书等等. 在上述生成的文件中,接收服务端加密报文:pkcs ...

  2. 逻辑关系下的NN应用

    ​ 自己好奇搜了几篇别人对Ng视频的的笔记,读下去可观性很强,后回到自己的笔记却觉得矛盾很多,有些地方搞得很模糊,自己没有仔细去想导致写完读起来很怪,此篇之后我决定放慢记笔记的速度,力求尽多地搞清楚模 ...

  3. HTML基础了解

     对HTML最基本的认识和编写:"我的第一个网页" HTML是什么: 它的全称是Hyper Text Markup Language超文本标记语言,页面中包括有视频.图片.链接等其 ...

  4. docker--数据卷与数据卷容器

    docker--数据卷与数据卷容器 1.数据卷: 创建一个volumes的文件夹: [root@docker01 /]# mkdir volumes [root@docker01 /]# ls bin ...

  5. oracle 树形表结构查询 排序

    oracle 树形表结构排序 select * from Table start with parentid is null connect by prior id=parentid order SI ...

  6. php中curl远程调用获取数据

    $jump_url=$this->_post('locations'); $url=htmlspecialchars_decode($jump_url); $ch = curl_init(); ...

  7. 机器学习之分类问题实战(基于UCI Bank Marketing Dataset)

    导读: 分类问题是机器学习应用中的常见问题,而二分类问题是其中的典型,例如垃圾邮件的识别.本文基于UCI机器学习数据库中的银行营销数据集,从对数据集进行探索,数据预处理和特征工程,到学习模型的评估与选 ...

  8. Gitlab维护记录

    目前互联网公司主流的代码仓库统是gitlab,类似github的实现,维护gitlab已经有两年多的时间, 下面说一下维护过程中的注意点,以及如何维护更好. 分别是搭建,首先得搭建起来,不然怎么玩,其 ...

  9. PHP基础入门(五)---PHP面向对象

    前言: 今天来和大家介绍一下PHP的面向对象.说到面向对象,我不得不提一下面向过程,因为本人在初学时,常常分不清楚. 那么面向对象和面向过程有什么区别呢?下面给大家简单介绍一下: 面向对象专注于由哪个 ...

  10. 超好用的memcache管理及可视化监控工具,真方便!

    memcache做为主流的缓存数据库之一,广泛在各互联网平台使用,但是大家使用中都知道memcache目前没有一个比较好用的可视化客户端工具,每次都要输入命令进行操作,十分不方便.  而另一款主流缓存 ...