Model the real world

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ebybymic (Talk); changed back to last version by Jenny Harlow)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://yjucofi.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
----
 
=[http://yjucofi.co.cc CLICK HERE]=
 
----
 
</div>
 
 
:''Model the real world whenever possible. (This heuristic is often violated for reasons of system intelligence distribution, avoidance of god classes, and the keeping of related data and behavior in one place).'' --Riel's Heuristic 3.6, [[Arthur Riel 1996]]
 
:''Model the real world whenever possible. (This heuristic is often violated for reasons of system intelligence distribution, avoidance of god classes, and the keeping of related data and behavior in one place).'' --Riel's Heuristic 3.6, [[Arthur Riel 1996]]
  
 
Object Oriented programming is all about modelling the real world. We do this because in theory it is easier to think about how something works if it exists in the real world. For example, a trivial ''Car'' class would be easy to implement, as most people know what a car is made up of, at a high level sense. Modeling real world objects is considered easier than modeling complex, artificial algorithms and control processes that only exist in the domain of the program they are being developed for.
 
Object Oriented programming is all about modelling the real world. We do this because in theory it is easier to think about how something works if it exists in the real world. For example, a trivial ''Car'' class would be easy to implement, as most people know what a car is made up of, at a high level sense. Modeling real world objects is considered easier than modeling complex, artificial algorithms and control processes that only exist in the domain of the program they are being developed for.
  
OO also gives programmers a way to decompose a problem into smaller components that &quot;make sense&quot;. Of course, this all relies on being able to make good OO models (ie choosing good classes). The main guideline is to model what actually exists in the real world. For example, ''Car'' and ''Road'' may be good OO classes, but ''VehicleAndRoadController'' probably isn't very good. A class name that has no meaning outside of the computer program may be a sign you are not modeling the real world. Of course, exceptions will occur in certain domains, and it is not often as easy as just &quot;modeling the real world&quot;.
+
OO also gives programmers a way to decompose a problem into smaller components that "make sense". Of course, this all relies on being able to make good OO models (ie choosing good classes). The main guideline is to model what actually exists in the real world. For example, ''Car'' and ''Road'' may be good OO classes, but ''VehicleAndRoadController'' probably isn't very good. A class name that has no meaning outside of the computer program may be a sign you are not modeling the real world. Of course, exceptions will occur in certain domains, and it is not often as easy as just "modeling the real world".
  
 
==See also==
 
==See also==

Latest revision as of 03:11, 25 November 2010

Model the real world whenever possible. (This heuristic is often violated for reasons of system intelligence distribution, avoidance of god classes, and the keeping of related data and behavior in one place). --Riel's Heuristic 3.6, Arthur Riel 1996

Object Oriented programming is all about modelling the real world. We do this because in theory it is easier to think about how something works if it exists in the real world. For example, a trivial Car class would be easy to implement, as most people know what a car is made up of, at a high level sense. Modeling real world objects is considered easier than modeling complex, artificial algorithms and control processes that only exist in the domain of the program they are being developed for.

OO also gives programmers a way to decompose a problem into smaller components that "make sense". Of course, this all relies on being able to make good OO models (ie choosing good classes). The main guideline is to model what actually exists in the real world. For example, Car and Road may be good OO classes, but VehicleAndRoadController probably isn't very good. A class name that has no meaning outside of the computer program may be a sign you are not modeling the real world. Of course, exceptions will occur in certain domains, and it is not often as easy as just "modeling the real world".

See also

Domain model pattern

Personal tools