previous | start | next

## JavaBeans Components

- This bean has two properties: `creditCard` and `shopping`
- Do not make any assumptions about the internal representation of properties
  - May have an instance field for every property:

        private String creditCard;
        private boolean shopping;

  - May store the credit card state in a database
    - get and set methods would contain database operations
  - May compute the property value:

        public boolean isShopping() { return shoppingCart != null; }

previous | start | next