You are previewing Maven: The Definitive Guide.

Maven: The Definitive Guide

Cover of Maven: The Definitive Guide by Sonatype Company Published by O'Reilly Media, Inc.
O'Reilly logo

The Simple Model Module

The first thing most enterprise projects need is an object model. An object model captures the core set of domain objects in any system. A banking system might have an object model that consists of Account, Customer, and Transaction objects, or a system to capture and communicate sports scores might have Team and Game objects. Whatever it is, there’s a good chance that you’ve modeled the concepts in your system in an object model. It is a common practice in Maven projects to separate this project into a separate project that is widely referenced. In this example system, we are capturing each query to the Yahoo! Weather feed with a Weather object that references four other objects. Wind direction, chill, and speed are stored in a Wind object. Location data including the zip code, city, region, and country are stored in a Location class. Atmospheric conditions such as the humidity, maximum visibility, barometric pressure, and whether the pressure is rising or falling is stored in an Atmosphere class. A textual description of conditions, the temperature, and the data of the observation is stored in a Condition class. See Figure 7-2.

Simple object model for weather data

Figure 7-2. Simple object model for weather data

The pom.xml file for this simple model object contains one dependency that bears some explanation. Our object model is annotated with Hibernate Annotations. We use these annotations to ...

The best content for your career. Discover unlimited learning on demand for around $1/day.