你甚至可以在domain类中注入服务,这可以帮助开发出各种丰富的domain:
class Book {
…
def bookService
def buyBook() {
bookService.buyBook(this)
}
}
你甚至可以在domain类中注入服务,这可以帮助开发出各种丰富的domain:
class Book {
…
def bookService
def buyBook() {
bookService.buyBook(this)
}
}