Objects 101

A developer is writing an HR system using Object Oriented Programming (OOP). The HR system will hold details of all employees, their pay, schedules, and other data. During the design, she decides that she needs an "Employee" Class. Which of these options would best describe the "Employee" Class?

  1. A template which describes the types of data which will be stored/processed for every employee.
  2. The data relating to a single employee.
  3. A template which describes the processing rules for the employee data.
  4. A template which describes the data fields, the processing behavior and the default data for an employee on the system.
  5. A template which describes the default data to be used when an employee is initialized in the system.
1 5 4 2 3

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Tony Flury
Sep 19, 2015

In a classic OOP system your classes should define the data to be held, the defaults used when the class is used, and the behaviour that class exposes (by defining methods). All of these components together are the full definition of a class (although in some cases your class might not have any sensible defaults).

In case you were wondering - Answer 2 : "The data relating to a single employee" is properly called an instance of the Employee class, and Answers 1,3 & 5 are parts of the class definition - but not the whole definition.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...