- What's Covered in This Chapter
- Design Approach and Artifact Choices
- Free-Form Architecture Diagram
- From User Stories to Design
- Exploring Classes Using CRC Cards
- Application Flow Map (Homegrown Artifact)
- UML Class Diagram
- UML Package Diagram
- Directory Structure
- Sample File Names
- End-to-End Development Steps
- Acceptance Tests
- Other Considerations
- Summary
- Recommended Resources
Free-Form Architecture Diagram
Figure 3.2 shows the high-level architecture for our sample application. Note that this has been converted to an electronic version from the whiteboard version we saw at the end of the previous chapter. Converting it to an electronic format is a personal preference; you could just as easily take a digital picture of the whiteboard version, but I personally like clean and readable diagrams.
Figure 3.2 High-level architecture for Time Expression.
The architecture is fairly straightforward. We have our standard three-tier web architecture with the client tier (web browser), middle tier (application server), and our data tier (database).
Also standard is the use of the model-view-controller (MVC) design pattern, as you find in most Java-based web frameworks these days. The controller is the point of entry of the HTTP/web request; it controls the model and the view. The model deals with data, which is obtained by the controller and passed to the view for rendering in a presentable way. In our case, the view will be written using JavaServer Pages (JSP).
What makes our architecture interesting isn't that it uses a MVC pattern, but rather what's in the middle tier, namely the Spring Framework and Hibernate, two technologies we will cover in detail later in the book. Hibernate, as you will see later, makes database persistence very easy because you can reference database tables and records as plain old Java objects (POJOs). The Spring Framework (springframework.org) provides many benefits, as well, especially when you're working with POJOs. For example, we will use the Spring MVC for our web framework because it makes for cleaner code (when compared to something like Struts). Another notable feature of the Spring Framework is the support for scheduling jobs rather than depending on an external scheduling service such as CRON or the Windows Scheduler. Of course, the core feature provided by the Spring Framework is the inversion of control (IoC) functionality, which we will learn about in later chapters.