Re: Platform-Agnostic Code
Re: Platform-Agnostic Code
- Subject: Re: Platform-Agnostic Code
- From: "Corey O'Connor" <email@hidden>
- Date: Sat, 15 Jan 2005 15:39:14 -0800
Well, you'll only be able to make the OSX UI with Cocoa. The other
platforms will have there UIs written in there native UI toolkits.
There are APIs (WxWindows, Trolltech QT) that will allow a single
codebase for the UI and model or all supported platforms. IMHO
applications written with these frameworks never feel like native
applications. They all code to the common denominator for all
platforms, so all the UIs, feel and look the same. Which is both good
and bad. They are consistant between platforms. but sometimes do not
follow the UI conventions for each platform.
"Any problem can be solved with a layer of abstraction"
Can't remember who said that, but they were rght. :-)
Cocoa encourages you to follow the Model-View-Controller (MVC) pattern
of software design. This abstracts the UI from the backend code (the
model). The UI is only how your application looks; absolutely nothing
more. The model is your application's behavior and state. The
controller provides the bridge between the UI and the model, defining
how the UI interacts with the model.
By following this pattern the UI can vary independently of the actual
meat of your application: The model. If you write the model in a cross
platform way, which is pretty easy for the model layer, then you can
port your application to any platform and have the application look
and feel right for that platform. You could have a command line
version for the linux crew. A Windows Forms one for the windows chaps.
A nice Cocoa application for the OS X people.
You have to be careful to use a cross platform API in the model layer
though. Sticking to standard C++ will get you very far. Past that,
you'll have to make/use another abstraction layer to keep the
application cross-platform. I suppose you could also stick to Java,
Python, OCaml or whatever you could hook Cocoa to. C++ just has the
most accessible collection of APIs.
--
-Corey O'Connor
On Sat, 15 Jan 2005 13:50:59 -0500, Greg Deward <email@hidden> wrote:
> I just read this in the "Into for Developers" document:
>
> "Developers coming from UNIX and other OS platforms often use Cocoa to
> a build state-of-the-art Aqua user interface on top of a core of
> portable, platform-agnostic code. "
>
> This is great news for me as I want to build an app, with a compiled
> interface, that is deployable on multiple platforms (Mac, Linux, and
> Windows). Does anyone know of a sample app somewhere that leverages
> this type of platform-agnostic code with Cocoa? I would love to
> actually see how it fits together.
>
> Thank you.
>
> Greg D.
_______________________________________________
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