QUIZ 2
- Describe the concept separating interface from implementation.
- Easier to modify programs
- Hints about other implementation; private members
- Header files
- Class definitions and function prototypes
- Included in each file using class; #include
- File extension .h
- Source-code files
- Member function definitions
- Same base name; Convention
- Compiled and linked
- What are the utility functions? Compare with access functions.
Not all member functions need be made public to serve as part of the interface of the class.
- Access functions in public
- Read/display data
- Predicate functions
- Check conditions
- Utility functions (helper functions)
- Utility functions in private
- Support operation of public member functions
- Not intended for direct client use
- Write a code fragment to show Utility function demonstration. (see Fig 1)
Figure 1:
SalesPerson class definition
|
- Describe the Software Reusability as a OOP concept.
- Class libraries
- Well-defined
- Carefully tested
- Well-documented
- Portable
- Widely available
- Speeds development of powerful, high-quality software
- Rapid applications development (RAD)
- Resulting problems
- Cataloging schemes
- Licensing schemes
- Protection mechanisms
2004-10-21