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.
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 ...
Get Maven: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.