Re: Engeneering a Cocoa Application
Re: Engeneering a Cocoa Application
- Subject: Re: Engeneering a Cocoa Application
- From: Scott Ellsworth <email@hidden>
- Date: Thu, 6 Apr 2006 10:58:04 -0700
On Apr 6, 2006, at 8:39 AM, Matteo Manferdini wrote:
Hi everyone.
Howdy.
I was wondering how you develop a Cocoa Application. Cocoa in full
of mechanisms not present in other languages, such as bindings,
core data or interface design with Interface builder.
True, but they are all cognates of things in other languages
For example, Core Data gives you a data model, represented as a
relational database that returns objects for the entities. (i.e.
rectangular tables holding entities with identical attributes,
connected via relationships based on corresponding attributes.)
There are other model forms used by developers, but this one is
pretty common, so CD has a fair amount of applicability.
The controller layer, which is very closely tied with bindings, does
what controllers always do - connect models and views. It is unique
in that it handles a lot of the notification magic that makes
controllers tough to write if they are not glued into the view classes.
The view layer is generally good, especially if you can do what you
need with the existing views and with custom view subclasses that do
not need bindings. I do find IB and bindings weak when it comes time
to add a custom view that could use a few bindings; it would be far
better if there were a tag that IB could read to build the bindings
panel for any old custom view subclass.
So, even though there are a lot of neat tools, the _roles_ they play
should match up to roles you have heard of before.
So, from where you start when you develop a Cocoa Application? From
the interface? Or from below, defining data and classes first? Or
maybe a mix of all?
Depends on what I have. A current app is all about the view, so I am
starting with that. A previous app was data driven, so I started
with my CD data model. Sometimes, I have a specific class that is
the obvious place to start. In all these cases, I start by asking
two key questions: what is the hardest thing I am going to have to
do, and what behavior do I absolutely know I will need. I then try
to mock up in IB, graffle, or a whiteboard, a potential UI to do the
common and the hardest tasks. This usually gives me a pretty good
idea of where I need to really put my effort, and that is where I start.
And how do you test your new application while you are developing it?
The built in unit testing features of XCode work well for the model
behavior. I am still trying to figure out how best to test UI
elements. Chris Hanson suggested using infoForBinding in unit tests
to at least make sure the required items were hooked up, and that
makes some sense.
Scott
_______________________________________________
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