Chapter 3. A data-driven portlet made easy
This chapter covers
- Designing a portlet for database interaction
- Liferay’s Service Builder code generator
- Architecting applications using DAOs and DTOs
- Defining relationships using Service Builder
For the rest of this book, we’ll use a case study to illustrate the examples. You’ll be building a site for a fictitious company. The example company is a combination of two things I love: fountain pens and technology. Normally, you wouldn’t expect those to go together, but as you’ll see, this may be possible (at least in theory).
If you’re a business entrepreneur who wants to pursue this idea, you have my blessing. Just know that I had the idea first, so I’ll be looking for my cut.
The purpose of using a case study as the unifying example site you’ll be building is simple. This approach avoids abstract examples (like the ones in the preceding chapter) and lets you build real-world solutions like those you’ll build for your own web site. This case study will help you apply concretely all the concepts we’ll cover. We’ll start with a data-driven portlet, which arguably is the most common type of application that developers work on every day. First let’s look at some background information about the case study, and then we’ll go over the design of your first portlet.