What Is PowerPlant
Volume Number: 14
Issue Number: 12
Column Tag: PowerPlant Workshop
What Is PowerPlant?
by John C. Daub, Austin, Texas, USA
An introduction to and overview of the Metrowerks
PowerPlant application framework
Introduction
Despite what many have said, I just don't see it. The Mac programming community
doesn't seem to be dying (like many naysayers suggested last year). People are still
flocking to the Mac (especially after the iMac introduction), and I still see newcomers
every day in the comp.sys.mac.oop.powerplant USENET newsgroup - all with a burning
desire to write the next "KillerApp." Many of the next generation programmers want
to use Metrowerks PowerPlant to accomplish their goal, but quickly run into the same
problem. PowerPlant is enormous, and can be intimidating - where and how do you
start? I have heard this complaint from many aspiring PowerPlant users, and I can't
blame them.
To try and help programmers become more familiar with PowerPlant, I decided to
write a series of articles that will introduce various parts of the PowerPlant
architecture to MacTech readers. These topics should be interesting to both new and
experienced programmers. I know few people that understand all of PowerPlant (or
even a large chunk), so I think there will be something for everyone.
This article will start with the very basics. We'll introduce frameworks in general,
and then PowerPlant in specific. We'll talk about the advantages of using PowerPlant,
and then describe the overall design of PowerPlant. We'll look into how event's are
handled in PowerPlant, and how information is communicated between different parts
of PowerPlant. You may see some simliarities to the first few chapters of the
PowerPlant Book, Metrowerks' official documentation for PowerPlant - a book I
highly recommend. In later articles, we'll get more "hands-on" and demostrate some of
the real power of PowerPlant. But first, let's start with the basics.
Background
Definition
What is PowerPlant? The easy answer is: PowerPlant is Metrowerks Corporation's
object-oriented application framework for Mac OS software development. It is written
in the C++ programming language, and takes full advantage of the features C++ offers
(such as multiple inheritance, polymorphism, templates, and namespaces).
PowerPlant provides programmers with a collection of solid, field-tested, code that
can serve as a mature foundation upon which to build your software product - letting
you build more reliable applications, in less time.
Not only does PowerPlant help you lay a rock-solid foundation for your application,
but PowerPlant also provides a wealth of tools beyond what you would expect from a
simple application framework. For example, there are TCP/IP networking classes;
debugging classes to help write better code; classes that simplify threading and extend
the capabilities of the Thread Manager; and classes for all the major Internet protocol
implementations (POP3, SMTP, FTP, HTTP, Finger, NTP, IRC). PowerPlant offers
flexible implementations of and support for Mac OS technologies like Drag and Drop,
the Appearance Manager, and the Contextual Menu Manager. PowerPlant includes cool
things like Attachments, that world-class Metrowerks Technical Support, and will
comply with and support Carbon as Carbon develops and evolves. That's just the short
list.
Pretty neat, huh? That list makes it seem like PowerPlant can do a lot. But there are a
lot of buzzwords and technical jargon in it that might not be familiar to you. Let's
break this definition into smaller pieces and examine each piece in turn.
PowerPlant Prerequisites
PowerPlant assumes two fundamental skills: you need to be able to use the C++
programming language and be able to use the Mac OS Toolbox.
PowerPlant is written in the ANSI/ISO C++ programming language. Earlier I
mentioned some wonderful C++ language features: namespace, template,
polymorphism, and multiple inheritance. You don't need to know anything about them.
They're certainly powerful features and if you're curious you might consider buying a
copy of the recently drafted ANSI/ISO C++ standard for those tough questions that will
occasionally arise. You do need to be able to write basic C++, and you'll need to know
how to use inheritence explore PowerPlant. But that's about it. Beginners are
certainly welcome here, and you will assuredly sharpen your C++ skills as you work
with the language.
PowerPlant simplifies and hides some of the OS-level details from you. For instance,
the Networking Classes unify the two TCP/IP mechanisms (MacTCP and Open
Transport) into a single API (Application Programmer's Interface) for TCP/IP
communication. Because you only have to talk to the single interface (PowerPlants
interface), you can write less code while still offering your application to many
different kinds of users. However, you can't always work from this higher level of
abstraction. At times you will have to get some dirt under your fingernails and dig into