优化三层

三层优化
1.加入接口
建议面向接口开发:先接口再实现类
—service、dao加入接口
—接口与实现类的命名规范
接口:interface, 起名 I实体类Service IStudentService
IStudentDao
实现类:implements 起名 实体类ServiceImpl StudentServiceImpl
StudentDaoImpl
接口命名:I实体类层所在的包名 例如: IStudentService、IStudentDao
接口所在的包: xxx.service xxx.dao
实现类命名:实体类所在包名Impl 形如: StudentServiceImpl、StudentDaoImpl
实现类所在的包: xxx.service.impl xxx.dao.impl
以后使用接口/实现类时,推荐写法:
接口 x=new 实现类() 《——多态的表现方式
面向接口开发
形如:IStudentDao studentDao=new StudentDaoImpl();
2.DBUtil 通用的数据库帮助类
帮助类一般写在 xxx.util包

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值