• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ease Your Effort of Putting Data into History Table
 

Ease Your Effort of Putting Data into History Table

on

  • 1,437 views

 

Statistics

Views

Total Views
1,437
Views on SlideShare
977
Embed Views
460

Actions

Likes
0
Downloads
1
Comments
0

22 Embeds 460

http://albert-myptc.blogspot.com 320
http://albert-myptc.blogspot.tw 75
http://albert-myptc.blogspot.com.es 10
http://albert-myptc.blogspot.in 10
http://albert-myptc.blogspot.com.br 7
http://webcache.googleusercontent.com 7
http://albert-myptc.blogspot.kr 4
http://albert-myptc.blogspot.co.il 3
http://albert-myptc.blogspot.hk 3
http://albert-myptc.blogspot.co.uk 3
http://albert-myptc.blogspot.jp 3
http://albert-myptc.blogspot.it 3
http://albert-myptc.blogspot.ca 2
http://albert-myptc.blogspot.fr 2
http://albert-myptc.blogspot.com.ar 1
http://albert-myptc.blogspot.se 1
http://albert-myptc.blogspot.de 1
http://albert-myptc.blogspot.mx 1
http://albert-myptc.blogspot.co.nz 1
http://albert-myptc.blogspot.ch 1
http://albert-myptc.blogspot.be 1
http://albert-myptc.blogspot.sg 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ease Your Effort of Putting Data into History Table Ease Your Effort of Putting Data into History Table Presentation Transcript

    • Ease Your Effort of Putting Data into History Table ALBERT KUO ALBERT_KUO@CHT.COM.TW
    • Scenario 2 違章事實代碼檔維護違章事實代碼資料 NIG015W NIG015W 違章事實代 新增/刪除/修 碼檔維護 改/查詢/列印 As user maintains violation fact code, system should keep its modification history. NIG015P 1.違章事實代碼檔[NIGT038]違章事實代碼 2.違章事實代碼異動記錄檔[NIGU038] 對照表
    • AS-IS 3 Spring Nig005Controller Nig005Service1 request Dispatcher Servlet 2 Nig010Controller Nig010Service 3 Nig015Service Nig015Controller 7 6 Nig020Controller Nig020Service response View NigXXXController NigxxxService Apache Tiles 4 5 Nigt038Dao Nigu038Dao Nigt039Dao Nigu039Dao NigtxxxDao NiguxxxDao
    • TO-BE 4 Spring Nig005Controller Nig005Service 1 request Dispatcher Servlet 2 Nig010Controller Nig010Service 3 Nig015Controller Nig015Service 6 7 Nig020Controller Nig020Service response View NigXXXController NigxxxService Apache Tiles 4 Nigt038Dao Nigu038Dao Nigt039Dao Nigu039Dao 5 NigtxxxDao NiguxxxDao1. Service class can simply focus on business logic and more clean.2. Service class does not need to care about if it should write data into history table or not.
    • How to do it? 5 1. Open Nigt038DaoImpl 2. Autowired Nigu038Dao 3. Overwrite create method 4. Overwrite delete method 5. Overwrite update method
    • Overwrite create method 6Copy entityattributes to Nigu038 Set PK values to Nigu038PK Set Nigu038PK to Nigu038’s id attribute Create data to Nigu038 via Nigu038Dao Create data to Nigt038
    • Overwrite delete method 7 Retrieveexisting data Copy values to Nigu038 Set PK values to Nigu038PK Set Nigu038PK to Nigu038’s id attribute Create data to Nigu038 via Nigu038Dao Create data to Nigt038
    • Overwrite update method 8 Retrieveexisting data Copy values to Nigu038 Set PK values to Nigu038PK Set Nigu038PK to Nigu038’s id attribute Create data to Nigu038 via Nigu038Dao Create data to Nigt038