Re: developing a cross-platform app?
Re: developing a cross-platform app?
- Subject: Re: developing a cross-platform app?
- From: James Chen <email@hidden>
- Date: Wed, 19 May 2004 09:39:44 +0800
Hi,
I think a well-designed architecture will help.
Based on Design Pattern, MVC architecture pattern will be better
candidate.
For example,
All you program logic should be cross-platform as a Model. ( Written in
C, C++ or other cross-platform language in a platform-independent
manner)
Form the user interface by using platform-dependent framework(SDK) or
cross-platform framework, such as Qt, as a View.
And finally write some code to glue Model and View together as a
Controller.
a paradigm:
--------------- WinController ----------- MFC Widgets
|
|
Model ---------------------- MacController ----------- Cocoa Widgets
|
|
-------------- LinuxController --------- Linux Widgets
|
|
.
or
Model ---------------------- QtController ----------- Qt Widgets
Following MVC, message from Model would be sent to controller and
forward to view.
And message from view would be sent to model via controller.
Therefore the UI code and Model wouldn't be bound together directly. So
that the Model would be reusable.
HTH,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On May 19, 2004, at 4:22 AM, David Feldman wrote:
I'm a Cocoa developer looking to write a cross-platform app. The app's
innards are fairly complex and thus I'm looking to write them in a
platform-agnostic manner that only requires a recompile. Keeping them
object-oriented also seems like a good idea as the app has several
distinct components. Initially I'm looking at Mac and Windows
versions, but ultimately a Linux version would be useful as well.
On the Mac side I'll do the UI and other OS-specific stuff in
Cocoa/Obj-C, and on the Windows side .NET/C#.
What I'm not clear on is how best to proceed connecting all these
pieces. I could wrap all the platform-agnostic C++ code in COM, which
is supported both on Mac and Windows, and that would allow the
platform-specific stuff to send messages to it. But how would the C++
stuff send messages back to the platform-specific objects? I'm simply
not clear what's the best way to do this sort of thing, nor do I know
where to look to learn more.
Any thoughts would be appreciated.
Thanks,
--Dave
-----------------------------------------------------------------------
---
David A. Feldman
User Interface Designer
http://InterfaceThis.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.