Li, Zhilin (1998) Replace a NULL pointer by a null object using object-oriented method. Other thesis, Concordia University.
| PDF 6Mb |
Abstract
Pointers are one of the most powerful and flexible features in C/C++, but they are also one of the most dangerous ones to use. Safe proramming practice requires a pointer to be initialized to NULL once declared. However a NULL pointer does not solve the problem completely. Accessing a NULL pointer may crash the application without offering any useful clues to the real problem. In Object-Oriented design, we can view a NULL pointer as a special kind of object with special behaviors and implement a null object to replace the NULL pointer. Accessing a null object will not crash the application, instead it can perform meaningful operations or display more helpful error messages. In this project, we implement a binary search tree, an AVL tree, a singly linked list using both the traditional NULL pointer method and the Object-Oriented null object method. We then compared the two methods in terms of safety, coding complexity, and time/space efficiency. The implementation language is C++
| Divisions: | Concordia University > Faculty of Engineering and Computer Science > Computer Science and Software Engineering |
|---|---|
| Item Type: | Thesis (Other) |
| Authors: | Li, Zhilin |
| Pagination: | xii, 218 leaves ; 29 cm. |
| Institution: | Concordia University |
| Degree Name: | Major reports (M.Comp.Sc.) |
| Program: | Computer Science and Software Engineering |
| Date: | 1998 |
| Thesis Supervisor(s): | Grogono, Peter |
| ID Code: | 508 |
| Deposited By: | Concordia University Libraries |
| Deposited On: | 27 Aug 2009 13:12 |
| Last Modified: | 08 Dec 2010 10:15 |
| Related URLs: |
Repository Staff Only: item control page

