Re: Newbie question: application architecture
Re: Newbie question: application architecture
- Subject: Re: Newbie question: application architecture
- From: Douglas Davidson <email@hidden>
- Date: Thu, 16 Aug 2001 15:29:41 -0700
On Thursday, August 16, 2001, at 02:56 PM, Jeff Howe wrote:
The question I have here is how to implement this application
architecture
under Cocoa. I have read about Frameworks and Buldles, but I am not sure
which is more appropriate to use, and not clear that either of these
really
suits our needs, and if so, how to go about using them. OK, that's
about 5
questions -- hopefully, you get the idea. I also have other questions
pertaining to how best to go about making Project Builder projects for
these, but those are probably better addressed in the
projectbuilder-user
list, right?
If you link against something, you probably want to make it a
framework. You then have a choice of where to put it--inside your
application's bundle, or in one of the various standard system
locations. This depends a bit on whether it is intended to be used by
one application or to be shared by many.
If you load something explicitly, you can either make it a framework or
a loadable bundle. There are a number of advantages and disadvantages
to either route, but generally loadable bundles are more appropriate for
things you think of as plugins (always use private namespaces, can be
unloaded) and frameworks are more appropriate for things you think of as
shared libraries (lazily linked per-module).
In either case, you then would decide whether you want to use CFBundle
or NSBundle to explicitly load your framework or loadable bundle. If
the thing you are loading has a C interface defined in terms of named
exported functions, then you will probably want to use CFBundle. If it
has an Objective-C interface defined in terms of classes, protocols,
etc., then you will want to use NSBundle. There is also a
specialization of CFBundle called CFPlugIn, that provides advanced
interface management, beyond just looking up named entry points, but it
sounds like you aren't going that far; but if your interfaces themselves
are C++ and not just functions, then you might be interested in it.
As a newbie you will want to get more information from the project
builder list and documentation about how to actually build a framework
or loadable bundle, how to put it where you want it, how to link against
it, etc.
Douglas Davidson