Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Recipe 6. Control the Document’s Behavior > Step 1: Organize the Project’s Code

Step 1: Organize the Project’s Code

Before adding all the additional methods you will implement in this recipe, it would be a good idea to organize its code. It has gotten moderately large already, and it is in danger of becoming unwieldy or even unreadable if you don’t impose some organizing principle on it.

So far, the only organizing principle the book has explained is the larger structure of the classes themselves. The Cocoa frameworks are organized into two major groups, Foundation and the AppKit, having distinct functionality. As they are described in the Cocoa Fundamentals Guide, Foundation classes focus on data and operations on data that are unrelated to the graphical user interface, while AppKit classes focus on views and functionality that relate to the graphical user interface. The names and inheritance relationships of these classes make it easy to categorize the methods they implement according to the nature of the work they do. The classes of the Vermont Recipes application participate in this organizing principle by conforming to the structure imposed by the Cocoa frameworks, mostly because they are subclasses of built-in Cocoa classes.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint