GET: hello {name}!
via Spring Web MVC DispatcherServlet.
// given
GET: show all books in index page.
// when
// then
implement fetch book details functionality.
// given
a ready-to-wear form for book information.
// when
// then
implement create new book functionality.
- option 1: Edit / Delete / ...
- option 2: return data with JSON format => split front-end & back-end
- What's Spring IoC & DI?
- Service interface => different implementation
- Data Repository
- Mac OS: sudo mysql.service start
- Ubuntu : sudo service mysql start
- mysql -uroot, then run create_db.sql
- Continue working on project “thwo-bookshelf” Step4
- Change BookRepository (extends CrudRepository)
- Create Table WO_BOOK(ISBN, NAME, AUTHOR, PRICE)
- No need to write SQL statement in this part
- As a DEV/DBA I want to follow up database evolution versions So that I can get DB maintenance in control easily
- Example:
- V1: create the table BOOK
- V2: change BOOK’s column NAME -> TITLE
- V3: add unique key to (TITLE, AUTHOR)
- …
- Tips: Similar with VCS
- As an admin I want to add or amend the books So that other users can get those books
- As a general user I want to search books by title fuzzily So that I can get the books in the same topic
- As a general user I want to search books by category name So that I can get the books I am interested in
- As a general user I want to search books by price range So that I can get the books within the price
- As a general user I want to put stars(1-10) and comments on a book So that I can know the book average ranking and comments
- As a general user I want to get a book’s average stars and ranking So that I can know how popular the book is
- Integration Test
- SQL Statement
- Spring Data JPA / Hibernate
- CrudRepository / JpaRepository
- Flyway Migration
- Transactional
- Pagination Result