Changeset 187 for Dev/trunk/classes


Ignore:
Timestamp:
12/16/11 11:26:53 (13 years ago)
Author:
jkraaijeveld
Message:

Cleaned up some mess regarding lazy evaluation: classes without references no longer require a method evaluate(). Rather, ResearchToolObject? has a plain evaluate returning true in this case. Classes with references should override this method.

Location:
Dev/trunk/classes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/Application.php

    r186 r187  
    3434        {
    3535                //Do nothing, there are no references in application.
     36                return true;
    3637        }
    37 
    3838}
    3939?>
  • Dev/trunk/classes/Question.php

    r186 r187  
    4141        }
    4242
    43         /**
    44          * function evaluate()
    45          * evaluates all the references of this object.
    46          */
    47         public function evaluate()
    48         {
    49                 //Do nothing since Question does not contain any references
    50         }
    5143}
    5244
  • Dev/trunk/classes/ResearchToolObject.php

    r186 r187  
    88        public $uid;
    99//Uncomment when done with creating all evaluation methods \o/////
    10 //      public abstract function evaluate();
     10        public function evaluate()
     11        {
     12                return true;
     13        }
    1114}
    1215
  • Dev/trunk/classes/Respondent.php

    r186 r187  
    2727   }
    2828
    29    /*
    30         * function evaluate()
    31         * evaluates all the references.
    32         */
    33    public function evaluate()
    34    {
    35                 //Do nothing since Respondent does not contain any references.
    36    }
    37    
    3829}
    3930
  • Dev/trunk/classes/User.php

    r186 r187  
    2525        $this->password = $password;
    2626        }
    27 
    28         /**
    29          * function evaluate()
    30          * Evaluates all the references of this object.
    31          */
    32         public function evaluate()
    33         {
    34                 //Do nothing.
    35         }
    36 
    3727}
    3828
Note: See TracChangeset for help on using the changeset viewer.