I WILL NOT PUT BUSINESS LOGIC IN EVENT HANDLERS!
BookService.cfc- A service layer for book operations
Book.cfc- Represents a book in my system
A Service Layer defines an application's boundary [Cockburn PloP] and its set of available operations from the perspective of interfacing client layers. It encapsulates the application's business logic, controlling transactions and coordinating responses in the implementation of its operations. Martin Fowler
BookServiceobject will be my API to do operations as mentioned in my requirements and this is the object that will be used by my handlers. My
Bookobject will model a Book's data and behavior. It will be produced, saved and updated by the
BookServiceobject and will be used by event handlers in order to populate and validate them with data from the user.
Bookobject in order to present the data. As you can see, the event handlers are in charge of talking to the Domain Model for operations/business logic, controlling the user's input requests, populating the correct data into the
Bookmodel object and making sure that it is sent to the book service for persistence.