Chapter 11. Class Modeling

To be an effective object-oriented programmer, you must have a clear mental picture of the classes in your application and their relationships. Sometimes this "picture" is hard to form, because class relationships can be both complex and abstract. The class browser, discussed in Chapter 8, uses the project's index to list the details and organization of your project's classes. While this helps, it still doesn't present a bird's-eye view of your application's structure. Enter class modeling. Class modeling, new in Xcode 2.1, performs the same function as the class browser—but in a much more visual and customizable way.

You can create a class model document from any group of classes. This could be your entire application or just a set of functionally related classes. Xcode then graphs those classes, as shown in Figure 11-1. The class model tracks, and instantly reflects, any changes made to your source files. Unlike data modeling, discussed in the next chapter, the class modeler is not an editor. You cannot design or alter the declarations in a class model and then transform that model into code. Maybe in some future version of Xcode, the class modeler will evolve into a full-circle UML-like design environment. But for now, class modeling is strictly a visualization and documentation tool.

Figure 11-1

Figure 11-1. Figure 11-1

A class model is stored in a document. The documents ...

Get Beginning Xcode® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.