Beruflich Dokumente
Kultur Dokumente
eGovFrame Center
2012
Table of contents
I
II
III
IV
Page l
Composition of eGovFrame
}
}
Page l
Composition of eGovFrame
Page l
Composition of eGovFrame
Weaving: Linking aspects with other application types or objects to create an advised object
Core Concerns
Credit
Transfer
Deposit
Withdraw
Logging
Cross
cutting
Concerns
Core Concerns
Module
Calculating
interest
Credit
Transfer
Crosscutting
Concerns Module
Weaving
Security
Deposit
Withdraw
Security
Logging
Calculating
interest
Transaction
[ Separating Aspect]
[ Weaving]
Page l
Composition of eGovFrame
ORM does not use SQL in source code, instead, directly maps java classes to the
columns of the table or runs and handles SQL in the form of XML
Full ORM (Hibernate)
Business Logic
JDBC
Business Logic
DB Column
Java Class
Mapping
JDBC
SQL
Business Logic
Java-Mapping
DataBase
SQL MAP
(Process SQL in
the form of XML)
DataBase
Technology in use
General Development
Need direct mapping java classes to the table
columns
When SQL changes, directly modify source code
and deploy
No pattern
ORM based
Developers can be processed directly in terms of objectoriented
Can be applied only with modifications of the mapping
information
Mapping information, XML, etc can be applied in the form
of template
Directly control DB
SQL
Page l
Composition of eGovFrame
Statement st = null;
ResultSet rs = null;
try {
st = con.createStatement();
StringBuffer query = new StringBuffer();
query.append("\n SELECT A.CHKLST_NO,
");
query.append("\n
A.EVALFL_CD,
");
query.append("\n FROM PR_EVALIT_MB A
");
query.append("\n WHERE A.CHKLST_NO = '"
+ sChklstNo + "' ");
query.append("\n ORDER BY EVALIT_NO
rs = st.executeQuery(st.toString());
while(rs.next) {
...
}
Separation of
business
logic and S
QL
enhance
productivity,
maintainabilit
y, and
reusability,
// Component
List result =
ISqlManagement.getList(sql.id,value)
// SqlMap.xml
<select id=id resultclass =hmap>
SELECT A.CHKLST_NO, A.EVALFL_CD FROM
PR_EVALIT_MB A WHERE A.CHKLST_NO = #value#
ORDER BY EVALIT_NO
</select>
} finally {
try {rs.close();} catch (Exception e) {}
try {st.close();} catch (Exception e) {}
}
Page l
MVC
pattern concept
Composition of eGovFrame
Controller
View
Model
Http Response
Composition of eGovFrame
HandlerMapping
Controller
Request
Request
Request
Model
Contoller
Model and
View
Model and
View
(Biz
Logic)
Dispatcher Servlet
(Front Controller)
Response
Model and
View
View View Name
View
Resolver
Response
DB
View
(JSP)
Page l
Programming Procedure
Presentation Layer
HandlerMapping
Business Layer
Programming Procedure
Controller
DAO
Spring Config.
Service Interface
Dispatcher
Request
(ORM)
Servlet
SQL(XML)
View
(JSP)
ServiceImpl
ViewResolver
Spring Config
(transaction)
Data
Spring Config
(datasource)
Value Object
Development
DataBase
Value Object
Configuration
Spring Module
Page l
10
Programming Procedure
Programming Procedure
Output Screen
Page l
11
Programming Procedure
Programming Procedure
JSP
Controller
Service
DAO
VO
SQL
/** SampleService */
@Resource(name = "sampleService")
private EgovSampleService sampleService;
/**
* Inquire post list. (pageing)
* @param searchVO - SampleDefaultVO
* @param model
* @return "/sample/egovSampleList"
* @exception Exception
*/
@RequestMapping(value="/sample/egovSampleList.do")
public String selectSampleList(@ModelAttribute("searchVO") SampleDefaultVO searchVO,
ModelMap model) throws Exception {
List sampleList = sampleService.selectSampleList(searchVO);
model.addAttribute("resultList", sampleList);
return "/sample/egovSampleList";
}
}
Page l
12
Programming Procedure
Programming Procedure
Controller
ServiceImpl
DAO
VO
SQL
Page l
13
Programming Procedure
Programming Procedure
Controller
@Service("sampleService")
public class EgovSampleServiceImpl extends AbstractServiceImpl implements
EgovSampleService {
ServiceImpl
DAO
VO
SQL
/** SampleDAO */
@Resource(name="sampleDAO")
private SampleDAO sampleDAO;
/**
* Inquire post list.
* @param searchVO - VO including search information
* @return post list
* @exception Exception
*/
public List selectSampleList(SampleDefaultVO searchVO) throws Exception {
return sampleDAO.selectSampleList(searchVO);
}
}
Page l
14
Programming Procedure
Programming Procedure
Controller
Service
DAO
VO
SQL
@Repository("sampleDAO")
public class SampleDAO extends EgovAbstractDAO {
/**
* Inquire post list.
Call EgovAbstractDAOs list method to run iBatis
* @param searchVO - VO including search information
Query ID
* @return post list
* @exception Exception
*/
public list<SampleVO> selectSampleList(SampleVO vo) throws Exception {
return list("sampleDAO.selectSampleList_D", vo);
}
java.lang.Object
java.util.List
java.util.List
listWithPaging(java.lang.String queryId, java.lang.Object parameterObject, int pageIndex, int pageSize) : Execute sub range
list SQL mapping
java.lang.Object
void
int
15
Programming Procedure
Programming Procedure
Controller
Service
DAO
VO
SQL
<sqlMap namespace="Sample">
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap"/>
<typeAlias alias="searchVO" type="egovframework.rte.sample.service.SampleDefaultVO"/>
<resultMap id="sample" class="egovframework.rte.sample.service.SampleVO">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="description" column="description"/>
<result property="useYn" column="use_yn"/>
<result property="regUser" column="reg_user"/>
</resultMap>
<select id="sampleDAO.selectSampleList_D" parameterClass="searchVO" resultClass="egovMap>
SELECT
ID, NAME, DESCRIPTION, USE_YN, REG_USER
FROM SAMPLE
WHERE 1=1
<isEqual prepend="AND" property="searchCondition" compareValue="0">
ID = #searchKeyword#
</isEqual>
<isEqual prepend="AND" property="searchCondition" compareValue="1">
NAME LIKE '%' || #searchKeyword# || '%'
</isEqual>
ORDER BY ID DESC
LIMIT #recordCountPerPage# OFFSET #firstIndex#
</select>
</sqlMap>
Page l
16
Programming Procedure
Programming Procedure
VO : The object used for the purpose of data transfer between objects
JSP
Controller
Service
DAO
VO
SQL
Page l
17
Common Components
Example
- Notice board, log-in, string validation check, etc
Page l
18
Page l
19