Hello World, Getting TS + Domain Model + JSP to support Updates
Setup Tomcat and Eclipse:
Start where you left off with your solution from the TDD previous tutorial
Start Eclipse:
eclipse_luna
Use your previous project:
Server should already be set up:
Ids and Versions:
- Right now your database table, RDG and xml does not know or care about ids and version
- add id and version everywhere
- Consider that delete should take an id and version
- This means the link to delete should take an id and version
- find should take an id, not first name
- How will you get new ids for adding people? Just do something for now.
- You could make a service utility that is static/synchronized, scan the table the first time and store the max id
- All additional calls would just increment this max id and not touch the db again till the server got reset.
Creating TDG/Mapper/Pojo
- Convert your RDG into TDG/Mapper/Pojo
- Make sure everything is still used properly (the JSPs)
- Look at the examples and the thesis for guidance.
Updates and Optimistic Offline Lock
- If you get here, good for you.
- Have your mapper check for zero rows being updated and throw a Lost Update Exception
- Notify the user somehow.
- What should the xml return, should there be a status? Should it fail for Lost Update?
Note:
You still need that ssh tunnel or a local database. The databse table is the same as from the previous tutorial
Solutions:
RDG With Versions
TDG, Mapper and POJO
TDG, Mapper and POJO but using OOL