Space web hosting - 6 EJB 2.0 CMP: Basic Persistence Overview In
6 EJB 2.0 CMP: Basic Persistence Overview In Chapter 4, we started developing some simple enterprise beans, skipping over a lot of the details about developing enterprise beans. In this chapter, we ll take a thorough look at the process of developing entity beans. On the surface, some of this material may look familiar, but it is much more detailed and specific to entity beans. Entity beans model business concepts that can be expressed as nouns. This is a rule of thumb rather than a requirement, but it helps in determining when a business concept is a candidate for implementation as an entity bean. In grammar school you learned that nouns are words that describe a person, place, or thing. The concepts of person and place are fairly obvious: a person EJB might represent a customer or a passenger, and a place EJB might represent a city or a port-of-call. Similarly, entity beans often represent things : real-world objects like ships, credit cards, and so on. An EJB can even represent a fairly abstract thing, such as a ticket or a reservation. Entity beans describe both the state and behavior of real-world objects and allow developers to encapsulate the data and business rules associated with specific concepts; a Customer EJB encapsulates the data and business rules associated with a customer, and so on. This makes it possible for data associated with a concept to be manipulated consistently and safely. In Titan s cruise ship business, we can identify hundreds of business concepts that are nouns and therefore could conceivably be modeled by entity beans. We ve already seen a simple Cabin EJB in Chapter 4, and we ll develop Customer and Address EJBs in this chapter. Titan could clearly make use of a Cruise EJB, a Copyright (c) 2001 O’Reilly & Associates
Adult web hosting has rich experience in providing unique solutions for the customer’s needs, just check frontpage web hosting services.