前言
- JAVA开发团队,一些必要的基本知识和开发工具、环境、步骤的约定
- 版本0.1,维护人:Jason,Email: huifeng.jiao@tqmall.com
- 会不断更新,全部人均可以提出有益的建议、贡献内容,目标是打造一个简洁、快速、灵敏的团队工做流程
核心流程
- 确认业务需求(谁,要作什么)、阶段目标和工期,结果是一句话,时间30分钟,定义为Envision阶段
- 需求细化整理,需求方确认,结果是线稿图,必要的关键文案,时间半天,定位为Conception阶段
- 产品Axure细化为产品Demo html演示,产品与需求方、开发负责人三方确认,定稿Demo,时间:不连续的3个工做日,定位为Logical Design阶段
- 并行进行系统要创建在哪里,架构,数据来源,频率,请求特征,访问方式、验证等,准备线稿图,两个不连续工做日,定义为Physical Design阶段
- 肯定业务场景的业务流程和数据要求、接口名称、参数和返回数据,两个不连续工做日,定义为Develping阶段
- Jira根据业务场景,设计测试场景、测试用例,准备伪数据、真实数据,开发实时跟踪bug,修复,定义为Testing阶段
- 全部文档,都使用md撰写,做为项目的一部分,在git项目的根目录创建doc目录,存放,同步更新
- 造成部署文档、维护和配置文档,根据文档,进行部署,成为Deploying阶段
系统开发约定
接口和验证
- 接口方式是之后的工做方式,方便系统分拆、分布和异构之间的通讯,目前是REST+json
- OAUTH2方式验证
产品工做模式
前端工做模式
- Sublime,git pull project,html,放置在web目录下,请求和写入同域名下的数据(java服务)
- 和后台是REST通讯,请求方式get,post都可,后台兼容,对于企业内部系统,设置域名限制便可,考虑更多安全,能够改造为OAUTH2
- 基本的建议:sea.js,bootstrap,angular,bckkbone,这些须要技术部讨论,实践,选择,能够有多套针对不一样应用的方案
- 一段典型的前端代码:
个人代码
后端工做模式
典型开发
- Idea+git,spring+mybatis,新增一个业务场景的开发步骤
- 0.分为三个包,分别写对应代码,biz,dal,web
- 1.dal:确认涉及的表,确认是否model和映射xml,dao,没有则手工创建或者使用mybatis-generator-core-1.3.2.jar
- 2.biz:添加了对应service,完成基础的业务动做,例如
@Service
public class CustomerService extends BaseServiceImpl {
@Autowired
private CustomerDao customerDao;
public List
getAllCustomer() {
return super.getAll(customerDao);
}
- web:添加对应的控制器,控制业务流程,调用不一样biz的service,对外暴露访问的uri,例如
@Controller
@RequestMapping(value = "/customer")
public class CustomerController {
@Autowired
private CustomerService customerService;
@Autowired
private ContactsService contactsService;
@Autowired
private UserInfoService userInfoService;
@Autowired
private CommunicationLogService communicationLogService;
@InitBinder("customer")
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
@RequestMapping(value = "")
public String list(Model model, @PageableDefault(page = 1, value = 20, sort = "id",
direction = Direction.DESC) Pageable pageable, ServletRequest request) {
Map
searchParams = new HashMap
(); Page
page = customerService.getPageCustomer(pageable, searchParams); List
customerList = page.getContent(); List
contactIds = Lists.newArrayList(); List
userIds = Lists.newArrayList(); List
ids = Lists.newArrayList(); for (Customer customer : customerList) { if (customer.getId() != null && !ids.contains(customer.getId())) { ids.add(customer.getId()); } if (customer.getContactsId() != null && !contactIds .contains(customer.getContactsId().longValue())) { contactIds.add(customer.getContactsId().longValue()); } if (customer.getCreator() != null && !userIds.contains(customer.getCreator())) { userIds.add(customer.getCreator()); } if (customer.getUserIdService() != null && !userIds .contains(customer.getUserIdService().longValue())) { userIds.add(customer.getUserIdService().longValue()); } } List
contactsList = contactsService.getByIds(contactIds); return "customer/customerList"; } @RequestMapping(value = "/create") public String create(ModelMap model) { //省市区 model.addAttribute("customer", new Customer()); return "customer/customerForm"; }
测试和部署
测试和反馈