Re: Cocoa NIB Design Question in JPG
Re: Cocoa NIB Design Question in JPG
- Subject: Re: Cocoa NIB Design Question in JPG
- From: Uli Kusterer <email@hidden>
- Date: Thu, 5 Jan 2006 22:54:52 +0100
Am 28.12.2005 um 19:14 schrieb Koen Bok:
Hi I have a (noob) question about the best way to design my
application. It boils down to: how much nib files should I use.
You're not saying whether these are views that are switched in/out,
or windows. If the latter, only load times decide whether you want them
1) in a single NIB - app launches slower, but when the user wants to
use them they're up faster because they're already loaded. Handy if
the user is likely to use all of these views/windows during the
lifetime of the app.
2) Distributed across several NIBs - app launches faster, but user
has a little delay whenever a new view is loaded lazily. Handy if the
user is likely to use only few of these views, or if certain rarely-
used views take rather long to fill with values.
If these are views (e.g. in an NSTabView, or just shown/hidden as
needed using setHidden:) the above still applies, but it may be more
convenient to have them in a tab view one NIB because you can easily
make sure they all fit the content area of the window they're
displayed in, etc.
If you eventually plan to have lots of views (i.e. more than the 3
you have in your drawing), or you plan to have plug-ins that add
their own views in this area, #2 is definitely the more workable
approach, as your plugins could simply be a NIB plus a controller
object in a loadable bundle, and thus you'd be using effectively the
same code for your internal objects and the third-party plugins,
cutting down on duplication and debugging.
Note that, unless you have oodles of subviews in your detail views
(1-3), the load times for a NIB full of stuff are generally
negligible, and the gain in responsiveness for your user is bigger,
since at launch the hard disk or CD your app is on is spinning
anyway, but after working some time, a lazily-loaded view may cause
the drive to have to spin up again to load the additional NIB.
However, if you have several NIBs, you could always load all of them
at startup anyway (e.g. from your plugins).
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden