MacApp

MacApp was Apple Computer's primary object oriented application framework for the Mac OS for much of the 1990s. First released in 1985, it is arguably the first such system to be widely used, notably on a microcomputer platform. Microsoft's MFC and Borland's OWL were both based directly on MacApp concepts.

It seems that Apple paid less attention to it than others, however, as it was alternately developed intensely and then ignored for long periods through the 1990s. Many Mac developers eventually gave up on it and moved to newer tools such as Metrowerks' PowerPlant and Symantec's Think Class Library (TCL). MacApp had a brief reprieve between 2000 and 2001, but after demoing a new version at WWDC in June 2001, all development was cancelled that October.

Even with this checkered career, MacApp was used for a variety of major applications, including Adobe Photoshop and Freeway.

[edit]History

MacApp was a direct descendent of the Lisa Toolkit, Apple’s first effort in designing an object-oriented application framework. The MacApp and Lisa Toolkit projects were headed by Larry Tesler. The engineering team for the Toolkit and the initial implementation of MacApp included Larry Rosenstein, Scott Wallace, and Ken Doyle. MacApp was based on Object Pascal, Apple’s object-oriented extension to Pascal, developed in consultation with Pascal inventor Niklaus Wirth. At the time, Pascal was Apple's language of choice for Mac programming.

Writing a Mac program without an application framework is not an easy task, but at the time the object-oriented programming field was still very new and considered somewhat suspect by many developers. Early frameworks tended to confirm this suspicion, being large, slow, and typically inflexible.

MacApp was perhaps the first truly usable framework in all meanings of the term. Compiled applications were quite reasonable in terms of size and memory footprint, and the performance was not bad enough to make developers shy from it. Although "too simple" in its first releases, a number of follow-up versions quickly addressed the main problems. By this point, around 1987, the system had matured into a useful tool, and a number of developers starting using it on major projects. Given the small memory sizes and slow speeds of machines of the era, however, even the small overhead of MacApp was considered a bother, and developer uptake was not particularly widespread.

At this point the market was moving towards C++, and Apple was forced to move as well. The resulting MacApp 3.0 was subject to a long and heated debate between proponents of Object Pascal and C++ in the Usenet and other forums. Nevertheless 3.0 managed to garner a reasonable following after its release in 1991, even though the developer suite,Macintosh Programmer's Workshop (MPW), was growing hopelessly outdated. Poised for what appeared to be a success story, Apple then downsized the entire developer tools group, leaving both MacApp and MPW high and dry.

One of the reasons for this downsizing was Apple's long saga of attempting to introduce the "next great platform" for development, almost always in the form of a cross-platform system of some sort. Their first attempt was Bedrock, a class library created in partnership with Symantec that ran on the Mac and Windows, which died a lingering death as both parties eventually gave up on working with the other. One of the reasons for their problems was the creation of OpenDoc, which was itself developed into a cross-platform system that competed directly with Bedrock. There were some attempts to position Bedrock as an OpenDoc platform, but everyone involved knew this was nothing more than smoke and mirrors.

So with the next big thing just around the corner, MPW and MacApp simply were not important. It was much more important to put those developer resources into these new projects to help them reach the market sooner. But when none of them really did reach the market (OpenDoc's "success" was arguable at best) the Mac was left with tools that were now almost a decade old and simply could not compete with the newer products from third parties. Through the early 1990s competing frameworks grew into real competitors to MacApp. First Symantec's TCL garnered a small following, but then Metrowerks' PowerPlant generally took over the entire market.

Nevertheless, the core developers of MacApp refused to let it die, and continued to work on the system throughout the 1990s. When all of Apple's "official" cross-platform projects were finally in their death throes, the team decided to take it upon themselves to fix the problem, and announced in late 1996 that they would be providing a cross-platform version of MacApp instead. By this point in time Apple was in serious trouble in the marketplace, and most developers had long given up believing any of their claims after watching one such product after another disappear.

Throughout the continuing saga there remained a core of loyal MacApp users who grew increasingly frustrated at Apple's behavior, which by the late 1990s had grown to outright dismissal of their own product during the introduction of Cocoa. Things were so bad that a group of MacApp users went so far as to organize their own meeting at WWDC '98 under an assumed name, in order to avoid having Apple staffers refuse them a room to meet in.

These antics did not go entirely unnoticed within Apple, and in late 1999 a "new" team, consisting of members who had worked on it all along, was put together to bring out a new version. Included was the new Apple Class Suites (ACS), a thinner layer of C++ wrappers for many of the new Mac OS features being introduced from OpenStep. MacApp 3.0 Release XV was released on August 28, 2001 to the delight of many, all of whom were around to see history repeat itself in October when the product was killed once again, this time likely forever.

MacApp is still being kept alive by a dedicated group of developers who have maintained and enhanced the framework since Apple stopped supporting it in 2001. MacApp has been updated to fully support Carbon Events, Universal Binaries, Unicode Text, MLTE control, DataBrowser control, FSRefs, XML parsing, Custom Controls, Composite Window, Drawer Window, HIView Window and Custom Windows. MacApp also has C++ wrapper classes for HIObject and HIView. Also the Pascal version, based mainly on MacApp-2, has been ported to Mac OS X and Xcode. It features long Unicode filenames and streamed documents with automatic byte-swapping.

MacApp supports the Xcode IDE. In fact at WWDC 2005, after Apple announced the transition to Intel CPUs, it took a single developer 48 hours to update MacApp and the MacApp example apps to support Universal Binaries.

[edit]Description

This description is based on MacApp 3.0, which had a more advanced underlying model than the earlier 2.0 and differed in many significant ways.

An application built in MacApp followed the command pattern, in which user actions are encapsulated in objects containing event details, and then sent to the proper object to carry them out. In the Mac OS this simple chain of events is actually not all that easy to code "by hand", as the OS only supports extremely basic events like "mouse click" or "keypress". It is the role of MacApp's internal machinery to take these basic events, translate them into semantically higher-level commands, and then route the command to the proper object.

Not only did MacApp relieve the author of having to write this code, which every program requires, but also as a side-effect cleanly separated code into commands and their handlers. In doing so, the resulting program was considered to be, in Apple parlance, factored. This was important under System 7 and later versions of the Mac OS, where commands were expected to flow in not only from the user's actions, but from AppleScript and its underlying Apple Events system as well. Under MacApp, Apple Events were decoded into the same commands as if they had been initiated by direct user actions, meaning that the developer didn't have to write much, if any, code to directly handle Apple Events. This was a major problem for developers using earlier systems, including MacApp 2.0, which had no such separation and often led to Apple Event support being too difficult to bother with.

In keeping with its role as an application framework, MacApp also included a number of pre-rolled objects covering most of the basic Mac GUI—windows, menus, dialogs and similar widgets were all represented within the system. Unfortunately, Apple typically supplied lightweight wrappers over existing internal Mac OS code instead of providing systems that were usable in the "real world". For instance, the TTEView class was offered as the standard text editor, but the underlying TextEdit implementation was severely limited and Apple itself often stated it should not be used at all after the MLTE control was introduced. As a result, developers were often forced to buy add-on objects to address these sorts of needs, or roll their own. The lack of a set of professional quality GUI objects can be considered one of MacApp's biggest problems.

These problem has been addressed with the release of MacApp R16. MacApp R16 uses standard Carbon controls for all MacApp GUI objects. The EditText Carbon control uses the MLTE control for full Unicode Text support. The TTEView class has been superseded by the TMLTEView class which uses the MLTE control for full Unicode Text support.

[edit]External links

  • Programmer's Guide to MacApp - full documentation from the Inside Macintosh series
  • ClubMacApp Home page of post-Apple MacApp maintenance and development community, mothered by Apple's former tech lead.






你可能感兴趣的:(apple,application,System,pascal,events,frameworks)