mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 22:14:41 +00:00
docs: update model-view-viewmodel
This commit is contained in:
1 parent
2ad022053d
commit
b6a1f18acf
3 files changed
+52
-24
No files matched your search
+1
-1
@@ -34,5 +34,5 @@ public interface BookService {
|
||||
/* List all books
|
||||
* @return all books
|
||||
*/
|
||||
public List<Book> load();
|
||||
List<Book> load();
|
||||
}
|
||||
+3
-4
@@ -25,6 +25,8 @@
|
||||
package com.iluwatar.model.view.viewmodel;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
@@ -36,13 +38,10 @@ public class BookViewModel {
|
||||
|
||||
@WireVariable
|
||||
private List<Book> bookList;
|
||||
@Getter
|
||||
private Book selectedBook;
|
||||
private BookService bookService = new BookServiceImpl();
|
||||
|
||||
public Book getSelectedBook() {
|
||||
return selectedBook;
|
||||
}
|
||||
|
||||
@NotifyChange("selectedBook")
|
||||
public void setSelectedBook(Book selectedBook) {
|
||||
this.selectedBook = selectedBook;
|
||||
|
||||
Reference in new issue
Block a user