User Tools

Site Tools


glossary:natural_class

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
glossary:natural_class [2013-08-11 13:22] – links christianglossary:natural_class [2021-05-11 23:21] – old revision restored (2013-08-11 12:01) 95.216.157.239
Line 12: Line 12:
 ==== Description ==== ==== 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.+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 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.+Note that natural classes and [[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 ==== ==== Examples ====
  
-  * Classes like ''Book'', ''User'', ''Contract'', ''Order'', ''OrderItem'', etc. are natural classes and also domain classes.+  * 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 ''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.+  * Classes like ''ActionListener'', ''ConnectionAdapter'', ''BeanFactory'', ''InvocationHandler'', etc. are //not// natural but [[artificial classes]].
  
 ==== Alternative Definitions ==== ==== Alternative Definitions ====
glossary/natural_class.txt · Last modified: 2021-10-20 20:30 by christian