El patrón Bean

Este post es un esbozo


Este patrón se aplica a una clase. Generalmente un bean es una clase que representa una entidad, y se particulariza porque:
  1. cuenta con métodos getters y setters para sus atributos
  2. sus atributos siguen nomenclatura típica JAVA (empiezan en minúscula y si se componen de más de una palabra, la segunda y sucesivas empiezan en mayúscula)
  3. los métodos get/set se nombran como las variables anteponiendo get/set y con la primera letra de la variable en mayúscula
  4. implementa la interfaz Serializable o

Hasta aquí estamos hablando de un bean con propiedades simples.

Sin embargo un bean (JavaBeans™) permite cuatro tipos de propiedades. La especificación define estos tipos de propiedades:

  • Simple – A bean property with a single value whose changes are independent of changes in any other property.
  • Indexed – A bean property that supports a range of values instead of a single value.
  • Bound – A bean property for which a change to the property results in a notification being sent to some other bean.
  • Constrained – A bean property for which a change to the property results in validation by another bean. The other bean may reject the change if it is not appropriate.

One Response to “El patrón Bean”

  1. 2012 Fashion ideas bb…

    You know that children are growing up when they start asking questions that have answers….

Leave a Response

You must be logged in to post a comment.