Re: Newbie question: application architecture
Re: Newbie question: application architecture
- Subject: Re: Newbie question: application architecture
- From: "A. Jetha" <email@hidden>
- Date: Fri, 17 Aug 2001 10:33:22 -0400
The following applies to ObjC. I'm not sure whether it applies
to Carbon or other environments.
Bundle is an important concept. The application is a bundle
(called the mainBundle), Frameworks are a kind of bundle and of
course there is the normal bundle.
Frameworks differ from bundles in that they can work as shared
libraries if desired and the frameworks loadable code can
versioned (something very cool).
You can link your app against normal frameworks and ones that
are built as shared libs. If you link your app to these
frameworks, the code is implicitly loaded at launch time.
You can manually load normal frameworks and bundles at any time
with the following code snippet.
NSBundle *myBundle = [NSBundle bundleWithPath:@"your path here"];
// load the code & instantiate the principle class
myObject = [[[myBundle principalClass] alloc] init];
// you could also do this
// [myBundle load]
after this point you can instantiate classes in that loaded
bundle as normal once you have the bundle inited, you can get to
the resources (nibs and other files) by using the series of
'pathForResourceOfType' methods (see NSBundle.h) (loading
resources from the main executable works the same way)
Hope this helps ...
./aj
On Thursday, August 16, 2001, at 05: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?