Architecture Overview
Piedmont is AppForge’s SDK for extending its flagship product by creating component-based objects. As with COM on Windows, one or more Piedmont components can be housed within a module. On Windows, a module typically consists of an in-process dynamic link library (DLL) or an out-of-process executable (EXE). A Piedmont module consists of an in-process DLL on Windows, and a shared library on the Palm.
From a developer’s perspective,
Piedmont’s architecture resembles the approach taken
with ATL COM development. Much of the low-level work associated with
COM (IUnknown implementation, reference counting,
class factories, object creation, and module registration) is
delegated to Piedmont-generated subclasses, which inherit from your
class. In this way, Piedmont uses your class as a base class, and
never instantiates it directly.[61] This keeps the focus on
implementing interfaces in your class, while delegating the
housekeeping portions of COM to the derived classes. The same is true
for the module code. A virtual module class allows you to override
some virtual methods if desired. Otherwise, all object creation,
module registration, and other housekeeping is performed by the
derived class implementation.
We will see the details of this architecture unfold as we proceed with an example of our own.
[61] We will see later how
Piedmont deviates from this approach, using the
PUSH_IUNKNOWN_IMPL_UP directive, but this is the
default implementation.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access