O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A Simple Example: Text Editor

Assume for this example that you want to model a text editor in an object-oriented design. You could produce a list of objects at a high level that includes the following:

  • EditWindow

  • Menu

  • File

  • Printer

These are all contained inside the main application object, which is what you are trying to build. Each one will have some internal data and methods, as illustrated in Figure 15.2.

Figure 15.2. TextEditor Objects

Figure 15.2 lists only the most obvious methods and data items; were you building a complete application, you would need to refine this model further. For now, it is sufficient for you to be able to identify ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required