Suppose I’d like to decompose an application into functional parts. E.g. a customer data management part, a text-formatting part, an invoicing part. I’d prefer be such parts somehow simple but complete applications.
Furthermore, suppose I’d like to design parts, which may be reused in new or other applications. E.g. the customers data part could be used in a CRM solution, but as well in an invoicing application.
I’m in search for something like a compound documents architecture.
Questions…
- Which Apple / Cocoa technology should I use to create such functional parts?
- Would it be possible to enclose in a function part the data-store and the UI?
- If true, how could one use a UI of one application / part in another application?
- Does such infrastructure / framework / technology exist for Cocoa?
Probably simpler Questions…
Suppose I have two applications A and B. B provides an editor for some B-related data. Suppose B‘s editor is fully contained in an NSView subclass. Thus, the edit controls are fully contained inside the subclass.
- May I somehow make B’s NSView’s subclass live appear in an A’s windows.
My aim is not to live embed arbitrary stuff of B in A. It would be OK to instrument A and B by a certain common protocol.
Of interest…
I’m aware of Cocoa’s distributed objects technology, which allows applications to talk to each other even if they run on different compute nodes. But since DO simply provides a transport mechanism, it isn’t a solution for my high-level decomposition question.
While an application can register URL schemes to be called from other applications, they do not provide enough functionality – since URLs are one way from caller to called. See here and here.
Apple provides this Plug-In Architectures document – but focuses on one application’s own plug-ins. Furthermore Apple’s CFPlugin document might be of interest too (still valid?).
Matt Gallagher provides a short overview of various options in Five approaches to listening, observing and notifying in Cocoa. Except sending notifications through NSDistributedNotificationCenter, all options are application-local. Thus, the Apple document Notification Programming Topics is of interest, but more as a low-level object transport mechanism.
I’m pretty sure, that some years ago, a group of software developers/companies tried to implement some kind of dynamic data exchange at the Cocoa level. Their framework didn’t come from Apple. Unfortunately, I don’t remember their framework’s name.
How to open a new application within an existing NSView on OS X?
Influenced by…
My question is influenced by intents of the Android SDK. Citation:
‘An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed.’
Very loosely related…
- Web-related: InfoQ article about The Object Network: Linking up our APIs.
- A 1993 article by Dave Winer about IOA, an Interactive Object Architecture
Each “part” would probably constitute a framework or library. A framework is a special kind of library that encapsulates dynamically linked code, headers, and resources into a bundle; a library is either dynamically or statically linked and is essentially a bare binary file.
A framework or library can contain pretty much any code an application can, and an application can call any code in one. For more information, see the Dynamic Library Programming Guide on ADC.
If what you’re looking for is something that can be loaded into another application to gain access to your application (in whole or in part) then on Mac OS X, this would still be accomplished through a framework/library. On iOS, it’s not possible since inter-process communication is extremely limited, but a self-contained static library is still an option for code sharing.