1 Reply Latest reply on Oct 9, 2001 12:38 PM by Larry

    EntityBeans granularity

    Marcus Brito Novice

      Hello, people. I'd like to get some advice from you on an EntityBean granularity issue.

      Here's the scenario, which should be quite familiar for you: On my App there is a "Customer" entity. Each customer can have multiple Addresses. Each address contains, among many other things, a city. Each city should be in one state.

      Each state has a name and a two-letter acronym.
      Each city has a name, and a state.
      Each address has a city and many more attributes.
      Each customer has multiple addresses.

      Now, my Database has tables for STATE, CITY, ADDRESS and CUSTOMER.

      Should each of these entities (state, city, address...) be modeled as a EntityBean or should I just code the Customer as a bean?

        • 1. Re: EntityBeans granularity
          Larry Newbie

          Given the celibrated overhead of entity beans, I would need a very good reason to normalize the data to such a degree. Even in the extreme case where city and state must have their own tables, you can still combine the fields into the customer entity. By that I mean the ejbLoad can select from a join to load name, street, city, state all at once.

          Just my two cents.