您的位置:首页 > 其它

OA学习笔记-001-项目介绍

2016-02-28 16:49 381 查看
基本知识

框架工具

解决方案(经典应用)

项目 12天

==========================================

OA项目, 12天

BBS

一、什么是OA?
辅助管理、提高办公效率的系统。

二、OA中有什么功能?
...

==========================================

一、软件开发的步骤?
1,需求
2,设计
3,编码<---┓
4,测试----┛
5,部署与后期维护

二、每个步骤都要做什么,谁来做?
...

三、我们要做什么?
设计、编码、测试
^^^^
=============================================

设计、编码、测试、部署

一、分层
3层

View serlvet/action

Service 接口/实现类

Dao 接口/实现类

耦合 -- 解耦

二、所用技术
Struts2 + Hibernate + Spring + JBPM + Junit + jQuery + ...

三、开发环境
Windows + Tomcat + Eclipse/MyEclipse + MySQL + IE

四、代码规范
代码格式:Ctrl + Shift + F
命名规范:驼峰命名法
注释
...
// 第1步:...
int a = 1;
int b = 2;
int result = a + b;

// 第2步:...
User a = new User();
Department b = new Department();
a.setB(b);

五、一些约定
utf-8
id : Long

六、项目计划
共12天
----------------------------
搭建环境+基本功能 1天
系统管理 2天
权限 2天
论坛 3天
工作流+审批流转 2天 + 2天

================================================ 搭建环境

一、数据库
mysql> create database itcastoa0720 default character set utf8;
Query OK, 1 row affected (0.03 sec)
mysql> show create database itcastoa0720;
+--------------+-----------------------------------------------------------------------+
| Database | Create Database |
+--------------+-----------------------------------------------------------------------+
| itcastoa0720 | CREATE DATABASE `itcastoa0720` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+--------------+-----------------------------------------------------------------------+
1 row in set (0.02 sec)

二、MyEclipse工程
1,新Web工程,并把编码设为utf-8
2,添加框架环境
Junit
Struts2
Hibernate
Spring
3,整合SSH
Struts2与Spring整合
Hibernate与Spring整合
4,资源分类
5,配置日志

Struts2
jar包
struts.xml, web.xml
Hibernate
jar包:核心包, 必须包, jpa, c3p0, jdbc
hibernate.cfg.xml, *.hbm.xml
Spring
jar包
appicationContext.xml/beans.xml

声明一个bean
@Component("beanName")
@Controller
@Service
@Repository

配置bean的scope
@Scope("prototype")

注入bean
@Resource

Spring与Struts2整合
1,在web.xml中配置Spring的监听器
2,加一个jar包

Hibernate与Spring整合
1,管理SessionFactory实例(只需要一个)
2,声明式事务管理

Spring
IOC 管理对象..
AOP 事务管理..

代码:
boolean needLog = ConfigFile.getBooleanValue("needLog");

if( needLog ){
System.out.println("xxx"); // System.err.println("");
}

配置文件(mylog.properties)
needLog = true/false

slf4j
JDK logging --> logging.properties
Log4j --> log4j.properties
...

debug 调试信息
info 一般信息
warn 警告
error 错误
fatal 严重错误

================================================ 基本功能

User, UserDao
save(User user), update(), delete(), find(), ...
Role, RoleDao
save(Role role), update(), delete(), find(), ...
Student, StudentDao
save(Student student), update(), delete(), find(), ...
...

BaseDao<T>
save(T t), update(), delete(), find()

UserDao extends BaseDao<User> { ... }
RoleDao extends BaseDao<Role>{ ... }
...



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: