forked from okjsp/okmakeover
-
Notifications
You must be signed in to change notification settings - Fork 0
Guide 개발 Naming 규칙
정병태 edited this page Dec 26, 2013
·
1 revision
[Draft]
## Java > Service의 Class 와 Method의 Naming은 **Transaction에 영향**을 주기 때문에 **Naming Rule을 엄수**해야 합니다. > > [/WEB-INF/confgi/spring/spring-mybatis.xml](https://github.com/okjsp/okmakeover/blob/master/src/main/webapp/WEB-INF/config/spring/spring-mybatis.xml) 의 _transactionManager_ 부분 참조. ### Package소문자로만 이루어진 최소 단위의 명사형 단어 (부득이 단어 조합이 될 경우에도 소문자만을 이용하여 단어 조합)
Ex) member / casestudy / boardtype
- Model : 접미어 없음
- Controller : *Controller
- Service Interface : *Service
- Service Implement : *ServiceImpl
- Dao Interface : *Dao
//Example Member
net.okjsp.member.MemberController
net.okjsp.member.model.Member
net.okjsp.member.service.MemberService
net.okjsp.member.service.MemberServiceImpl
net.okjsp.member.dao.MemberDao
//Example CaseStudy
net.okjsp.casestudy.CaseStudyController
net.okjsp.casestudy.model.CaseStudy
net.okjsp.casestudy.service.CaseStudyService
net.okjsp.casestudy.service.CaseStudyServiceImpl
net.okjsp.casestudy.dao.CaseStudyDao
-
Service
- Create : create* 또는 add*
- Retrieve : get* 또는 check*
- Update : modify* 또는 change*
- Destroy : destroy* 또는 remove*
//Example MemberService
public List<Member> getList();
public Member getOne(int id):
public boolean checkDuplicate(String loginId);
public boolean create();
public boolean modify(int id);
public boolean destroy(int id);
public boolean addAuth(int id);
public boolean removeAuth(int id);
-
Dao
- Insert : insert*
- Select : select*
- Update : update*
- Delete : delete*
//Example MemberDao
public List<Member> selectList();
public Member selectOne(int id):
public int selectCount(String loginId);
public boolean insert();
public boolean update(int id);
public boolean updateStatus(int id);
public boolean delete(int id);
public boolean insertAuth(int id);
public boolean deleteAuth(int id);
/member/member_list.jsp
/member/member_form.jsp
/case_study/case_study_list.jsp
/case_study/case_study_result.jsp
Module 및 하위 프로그램 명은 대문자로 시작하는 CamelCase Style의 명사형 단어에 접미어 조합.
- Module : *App
- Factory : 접미어 없음
- Controller : *+액션명+Ctrl
- Provider : *Provider
- Service : *Service
// Module
var sampleApp = angular.module('SampleApp', ...);
// Factory
sampleApp.factory('Sample', function(){...});
// Provider
sampleApp.provider('SampleProvider', function() {...});
// Service
sampleApp.provider('SampleService', function() {...});
// Controller
sampleApp.controller('SampleListCtrl', function() {...});
sampleApp.controller('SampleViewCtrl', function() {...});
sampleApp.controller('SampleCreateCtrl', function() {...});
- angular JS의 module 은 모듈명을 Under score(_) 로 변환.
SampleApp > sample_app.js
/member/member_app.js
/case_study/case_study_app.js
/member/member_list.html
/member/member_form.html
/case_study/case_study_list.html
/case_study/case_study_view.html
/case_study/case_study_result.html