Class Normalization

I have been reading Agile Database Techiniques by Scott Ambler recently. In chapter 5, he talks about Object Normal Form, which obviously derives from classical Data Normal Form. The brief definitions are as follows:
  • First object normal form (1ONF): A class is in 1ONF when specific behavior required by an attribute that is actually a collection of similar attributes is encapsulated within its own class.
  • Second object normal form (2ONF): A class is in 2ONF when it is in 1ONF and when "shared" behavior required by more than one instance of the class is encapsulated within its own class(es).
  • Third object normal form (3ONF): A class is in 3ONF when it is in 2ONF and when it encapsulates only one set of cohensive behaviour.
I feel it's good as a guideline or checklist for class design, although the definitions are bit vague such as word "shared" which makes it a little hard to be applied in practice. It largely depends on the detailed business situation; yet in Data normalization, "dependency" is easier to identify than being "shared".

For further details, examples, and comments >>> (in Chinese)

你可能感兴趣的:(Class)