Object-oriented programming is the process of building reusable components to accomplish a particular task. The basic idea is that objects are run-time bodies that can represent any program need. An object can represent user-defined data, such as a customer or an account. In a simple example, a customer object could send a message to another object representing an account. An object can also represent any business entity. In an automotive dealership, for instance, a vehicle is a class. The car dealer would have a salesperson, a service center, a financing department, an invoice, a warranty, and a customer.
Can be used to trap user-initiated events
Traps can be invoked by calling them with system calls. The following section will discuss some of the ways traps can be used. A trap is a signal that indicates a specific kind of event. Hardware traps, for example, signal division by zero or an address fault. On the other hand, processes can also generate explicit traps, for example, during a system call. The system call will typically store its name and arguments on the stack, and a user-initiated trap will be generated.