Table of contents An Introduction to Object Oriented Programming
CLASS DESIGN
Tip 1: Provide Consistent and Intuitive Class Interface
Tip 2: Provide Common Properties of Classes in a Base Class
Tip 3: Do Not Expose Implementation Details in the Public Interface of the Class
Tip 4: Consider Providing Helper Classes While Designing Large Classes
Tip 5: Keep the Data Members Private
Tip 6: Provide Lowest Possible Access to Methods
Tip 7: Strive for Loose Coupling Between Classes
Tip 8: Beware of Order of Initialization Problems
Tip 9: Write Unit Tests for Classes
Tip 10: Avoid Low-level Code
OBJECT CREATION AND HANDLING
Tip 11: Avoid Calling Virtual Functions in Constructors
Tip 12: Consider Providing Factory Methods
Tip 13: Make Constructor Private if there are Only Static Members in the Class
Tip 14: Avoid Creating Unnecessary Temporary Objects
Tip 15: Prefer Creating Immutable Objects
Tip 16: Consider Creating and Using Null Objects
Tip 17: Provide Special Objects With Read Only Access in the Class Itself
OVERLOADING
Tip 18: Overload Functions Only if it is Intuitive and Unambiguous to the Programmers Using the Code
Tip 19: Overload Functions Only if the Functions Semantically do the Same Thing
Tip 20: Overload Operators Only if it is Natural and Improves the Readability of Code
Tip 21: Overload Symmetrical Operators or Family of Operators Together
INHERITANCE
Tip 22: Do Not use Inheritance When Only Values are Different Among Classes
Tip 23: Prefer Object Composition Over Inheritance
Tip 24: Avoid Inheriting from Multiple Classes
Tip 25: Prohibit Inheriting from a Standalone Class if the Class is not Meant for Inheritance
Tip 26: Consider Making Concrete Leaf Classes Non-inheritable
Tip 27: Write Code Referring to Generic Interfaces of Classes
Tip 28: Beware of Versioning Problems in Evolving Base Classes
Tip 29: Avoid Deep Inheritance Hierarchies
ABSTRACT CLASSES AND INTERFACES
Tip 30: Consider Making Common Base Classes as Abstract Classes
Tip 31: Use Abstract Classes for Modeling Abstract Properties and Sub-classing
Tip 32: Provide Default Implementation Class(es) with Abstract or Pure Interface Classes
Tip 33: Use Pure Interface Classes for Sub-typing and Multiple Inheritance
Tip 34: Consider Providing Adaptor Classes for Pure Interface Classes
Tip 35: Keep in Mind that Pure Interface Classes are Difficult to Evolve
RUNTIME POLYMORPHISM
Tip 36: Use Virtual Functions Instead of Chained ?If-Else? or ?Switch? Statements
Tip 37: Follow Liskov?s Substitution Principle (LSP)
Tip 38: While Overriding, Preserve the Basic Properties of Methods
REFLECTION AND RTTI
Tip 39: Avoid Using Reflection Extensively
Tip 40: Prefer Using Higher-level Language Features Instead of Reflection
Tip 41: Avoid Using RTTI Extensively
Tip 42: Prefer Using Virtual Functions Instead of RTTI
EXCEPTION HANDLING
Tip 43: Write Robust Code to Avoid Raising Unnecessary Exceptions
Tip 44: Throw User-defined Exceptions for Application or Logical Errors
Tip 45: Think About Providing a Graceful Exit if You Cannot Handle an Exceptional Condition
Tip 46: Never Write Empty (Do Nothing) Catch Blocks
Tip 47: Clearly Document the Exceptions that a Method Might Throw
Tip 48: Avoid Throwing or Catching General Exceptions; Prefer Specific Exceptions
Tip 49: Provide Catch Handlers for Specific Exceptions Before General Exceptions
Tip 50: Provide Contextual Information while Throwing an Exception
NAMESPACES
Tip 51: Use Namespaces for Avoiding Name-Clashes and Organizing the Software
Tip 52: Hierarchically Partition the Namespace
Tip 53: Selectively Introduce Only the Specific
Namespace Members You Need for the Code
Tip 54: Selectively Expose the Types to the Clients
Tip 55: Avoid Hiding of Names in Different Scopes
DESIGN AND REUSE
Tip 56: Strive for Eliminating all Forms of Code Duplication
Tip 57: Use Design Patterns Whenever Appropriate
Tip 58: Provide Frameworks for Effective Reuse of Architectural Design
Tip 59: Provide Class Libraries for Any Set of Related Reusable Classes
Tip 60: Know and Make Best Use of the Standard Library
New Features
Do you wish to get through IT interviews?
Do you wish to excel as a programmer?
Do you want to effectively use object oriented programming in your projects?
Help is at hand! 60 Tips for Object Oriented Programming is an invaluable guide for programmers. The tips focus on the truly tough stuff-proven techniques learnt through experience. By uniquely combining the concepts and practical applications of three important programming languages, C++, Java and C#, the author provides a comprehensive coverage of the domain including the semantics. Anyone with a basic understanding of programming can become a competent object oriented programmer after reading this book. Instead of syntactic issues, it helps you understand semantic and pragmatic details of the programming. Browse through it for your last-minute preparation for cracking IT interviews successfully.
Should be on the bookshelf of every object oriented programming professional!