10. Introducing the Books Application
Books is an application to help manage and list book reviews. This part covers the following:
Books Requirements
The intent of the Books application is to present to the user an overview of book reviews penned by an author. For each book, reviews that are either external or published with this application may be linked. This might be a link to an external online source (such as a different website) or simply to some information about a printed medium where the review is published. The user can list books by category and can search. There are quite a few requirements , which can be put out as small user stories:
As a review author, I would like to enter information about a book
As a review author, I would like to enter a review
As a review author, I want to maintain basic data like categories
As a user, I would like to read book-information and reviews
As a user, I would like to search for books by title, author, and ISBN
As a user, I would like to list books by category
As a user, I would like to retrieve and choose from lists of all books and all reviews
As a user, I would like to choose my preferred language, if available
All features available to the user use the same look and feelthat is, the navigation will stay on the same place whether a book or a review is currently displayed. The admin look and feel differs to visualize the different domain. The admin pages have a different background color to indicate the admin section. To achieve that, JSF templating is used. Later on, in the chapters in part IV, Alumni, Ill discuss approaches to change the look and feel according to the users choice.
Every book will be displayed in a table with the following information :
Although most information like title, author, publisher, and more will remain the same for every language, other information, such as the short descriptive text and categories, may be displayed in different languages. The current live version of Books supports English and German. This isnt a technical restrictionits only limited by translation capabilities.
Beside books, the Books application displays reviews . This structure is simple:
The application automatically adapts to different display sizes (thanks to responsive design).
Although the requirements are pretty simple, this application demonstrates a lot of techniques. Books is not a demo application only and is live on my website at http://it-rezension.de .
Because the applications data is well structured and homogeneous, it fits well with a SQL database. Books uses the JPA to access the database.
The look and feel and the adoption to various display sizes is realized by using Cascading Style Sheets (CSS) .
You can see the live version of Books on my website. By the way, you might use it as a bibliography in addition to this book.
Development Order
Nowwhere to start? With a prototype of the GUI that can be provided to the customer for further review? In many projects, that might be the option of choice. Some dialogs might be sketched first, including some navigation buttons to show the planned behavior of the software. These prototypes might be built by using presentation software or directly implemented with the target language (here, Java with JSF). The latter method conveys a better feeling to the customer.
Or should we model the big picture and the activity by drawing UML or other diagrams? Or design the data model (for example, with an entity diagram) first?
In practice, youll see all these approaches and many more. Which one is the best way to start a project depends on the project properties and the personal preferences of those involved.
The following procedure is what we call the waterfall model :
Collect and write down all requirements
Design and document the overall software architecture
Write down all planned functionality in detail
Program everything
Test the whole system
Write the user documentation and deliver it
That seems an elaborate method. And by the time the system is delivered, the requirements may have changed or some function may behave differently than how the customer expected (if the customer had a clear view about what to expect). A lesson: the waterfall method mostly fails. Agile methods are preferable. The Agile Manifesto (read it at http://agilemanifesto.org ) was a milestone in this movement.
Chop the project into pieces that are iterative and implemented in increments. For each iteration , we need a short planning session. A piece of software is developed or refined and tested andvery importantdelivered to the customer, or at least to an internal substitute of the customer. Thus, a short feedback loop can be included in the development process. The customer gets a quick overview of the software. Requirement changes can be incorporated quickly. Many agile people dont like the comparison, but in agile, within each iteration the development in fact follows something similar to the waterfall model, though a (very) small waterfall with a short feedback loop.
As a result of an iterative process, the development order might be changed due to influencing factors. And the detailed order becomes a bit less important because after every iteration , or sometimes within it, a correction might be applied.
For data-driven applications like Books (which mostly presents data stored somewhere to the user), I prefer to create dialog boxes as soon as possible. Because the first dialog should present a bit of the future look and feel to the user, we need an overall layout, a kind of frame where the dialog will be embedded.
What data should be used for this dialog? It depends on the size of the project, the number of people involved, their experience, and more. In any case, a good starting point is the data model. Depending on the team structure, the dialog can use this model and mock away any persistence. Database specialists might connect the data model via a service layer to the database.
Mocking data may be useful for testing or if different persons implement different parts for one feature (for example, the database part, service part, or presentation part). To present the work in progress to the user, some real data handling often suits better. As well see after implementing a first dialog in the next chapter, the service layer to access the data can be generalized and reused. So, its no problem to work with persisted data for each dialog from the very beginning.
In case of Books, the data structure isnt difficult to designwe start with the data model and database access and then create the dialog that uses this data. Working iteratively, this procedure is similarly repeated for every dialog.