====== Natural Class ====== ===== Meaning 1 ===== ==== Alternative Terms ==== /*i.e. alternative names meaning the same thing*/ ==== Definition ==== A **natural class** is a class which was not artificially created as part of the solution but derived from the problem domain of the software. ==== Description ==== Someone with no technical knowledge but knowledge about the application domain can come up with natural classes as they are just concepts and abstractions derived from the problem domain. Software typically also requires some [[artificial class|artificial classes]] for its solution but the [[principles:Model Principle]] tells to avoid them in favor of natural classes if there is no greater benefit from introducing an artificial class. According to [[principles:Model Principle|MP]] and [[principles:Tell don't Ask/Information Expert|TdA/IE]] functionality is mapped to natural classes and artificial ones are only created for special purposes. Often [[patterns]] make creating artificial classes necessary, although this is not always the case. Note that natural classes and [[domain class|domain classes]] are related but not the same notions. Each domain class is a natural class but not the other way around. A domain class is a class which is part of a [[patterns:domain model]] (typically stored in a database, etc.) whereas a natural class is just one which is not artificially created. Even classes like ''DatabaseConnection'' or ''HttpRequest'' are natural classes, because they represent a natural concept which exists independent of the software. Classes like ''BeanFactory'' or ''InvocationHandler'' on the other hand are not meaningful outside the context of the software, of the solution. So these are artificial classes. ==== Examples ==== * Classes like ''Book'', ''User'', ''Contract'', ''Order'', ''OrderItem'', etc. are natural classes and also domain classes. * Classes like ''Button'', ''TextField'', ''DatabaseConnection'', ''HttpRequest'', ''Time'', ''Integer'', ''Velocity'', ''Voltage'', etc. are also natural classes but typically not domain classes. * Classes like ''ActionListener'', ''ConnectionAdapter'', ''BeanFactory'', ''InvocationHandler'', etc. are //not// natural but artificial classes. ==== Alternative Definitions ==== /*i.e. slightly different definitions for basically the same thing*/ ==== See Also ==== * [[Artificial Class]] * [[Natural Coupling]] ==== Further Reading ==== ---- ===== Other Meanings ===== /*i.e. the same term referring to something different; put short mentions here or better add more detailed descriptions as additional sections */ ---- ===== Discussion ===== Discuss this wiki article and the term on the corresponding [[talk:glossary:Natural Class|talk page]].