Problem solving while programming, using object oriented design always starts with the questions like:

1. What Objects should be created to solve this problem?

For example, if we are making a project for arranging books in a library, then the objects that come to mind will be the books, the shelves we keep them in, inventory book, the catalog etc.

2. What are the properties of the object?

A property is something that defines the characteristics of the object. In our problem, a few properties are, the subject the book is based on, its author, the number of books a shelf can hold in, quantity of a particular book in the inventory etc.

3. What are the methods we use so that the given project achieves its purpose?

In our case some of the methods are, gather information for the book, check its subject and author, arrange it according to its subject, further arranging the books based on the author’s name, numbering the shelf and keeping the books of a particular subject in it, displaying the catalog based on author or the subject.

Its all about visualizing the problem and then breaking it into various tasks to interpret their dependencies and how they interact with each other.

MSDN has an excellent chapter, named Bits & Bytes, that details problem solving using object oriented design. It is a must read for learning the basics.

Be Sociable, Share!