RemObjects Software Gears
 
       

Adventures in Mac World - Part 2

{#} by marc hoffman 09/09/07 01:47:09 pm, 657 words, Categories: Oxygene, ROFX, Mono, Cocoa, Mac

In my previous blog post, we took a quick first look at developing Mac a application using Chrome and Mono. Since that post was written, a lot of things have happened. We’ve shipped Chrome 2.0.3, which not only introduced a new project template for Cocoa#, but also provides advanced IDE integration to auto-generate code based on the UI defined in NIB files – making it easy to access the controls you have dropped, and implement the event handers you defined, without having to manually declare them in code. Post 2.0.3, we’ve made some further improvements to he build experience that will ship in our next release in October: we’ve created some custom MSBuild magic that will allow you to generate a finished .app right from within Visual Studio. Which is pretty cool.

That’s all fine and well, you say, but what about our other products? After all, Chrome is but a small part of our product portfolio, and we’re saying we’re focused on enabling cross-platform development across the board.

So, eating our own dog food, i set out last weekend to give three more of our products a spin in the Mac arena: Data Abstract, RemObjects SDK and Internet Pack for .NET.

The result is what you see below, one of a handful of new (and related) sample applications that we are working on and will ship in a future release of DA. The common theme between all the the projects is that they use Data Abstract to access a database middle tier that we’re running on one of our servers. This database server provides info that many of our customers have been dying to get their hands on: namely, direct read-only access to (selected, public) parts of our internal bug databases.

So in addition to providing a useful and real-life sample project that illustrates some of the concepts of DA, you’re also getting useful application(s) you can use to browse for known issues in our products, see their status and what version they were or will be resolved in.

</rathole>

Getting back to the Mac: besides the obvious targets, WinForms, ASP.NET and Delphi clients, i’ve decided to also look into creating a Mac version of the BugDb client – not so much out of real need (i suspect the majority of our users are running Windows machines, for now), but more to put the new Cocoa# support in Chrome to use (and in the process streamline it some more) and to see how well Data Abstract and it’s supporting products, RO and IP, would fare on the Mac.

The answer is: surprisingly well. Of course, we’ve long been supporting and testing for Mono, so i suppose there should be no surprise at all that it “just worked”, but it was still amazing how easy it was to see live DA data show up in a native Mac OS X application.

I started with a plain MonoChrome Cocoa# project, designed the UI in Interface Builder to show one large NSTableView filling the main window. I then added a standard .NET “Component” class to my project and used the familiar WinForms design surface to build my DA client – drop the Remote Data Adapter and related components, right-click it to generate a Strongly Typed DataSet, add a call to Fill() to populate it, all standard stuff a DA user does in her sleep.

Finally, a mere two simple methods needed to be implemented on my ApplicationController, and the NSTableView showed populated with live data retrieved through Data Abstract:

I’ve got some more wrapping up to do to have a finished application – like providing a login/preferences dialog, maybe saving to a local briefcase file and adding an option to reload data - but the core data access was implemented and working in no time.

Four of our .NET products working in unison, creating a true Mac OS X app!

Comments, Pingbacks:

Comment from: David M [Visitor]
This looks great! From a user's perspective, when running / installing the application, how complex is it? Does it just work, can you bundle the Mono requirements, or does Mono need a separate installation first?

(I haven't used Mono to write any apps on OSX yet, so I don't know how seamless or like a normal OSX app using them is or if it's different in any way with Chrome.)
PermalinkPermalink 09/10/07 @ 03:05
Comment from: marc hoffman [Member] Email
David: you can bundle Mono inside your .app, but i haven't looked that doing that yet. The downside of doing that, of course, would be that if the user runs 5 different mono apps, he practically has 5 Mono runtimes installed. I think it would in most cases be preferable to just install Mono as [part of your installer.

As it stands now, my resulting .app does depend on Mono, but that's the only dependency. Beyond that, everything is contained in the .app (including the Data Abstract .dlls), so you do get single drag/drop deployment on systems that have Mono installed.

mkbundle seems to be the tool to use to completely pack Mono into your .app (see http://www.mono-project.com/Guide:Running_Mono_Applications for more details). but as i said, i haven't tried that myself, yet.
PermalinkPermalink 09/10/07 @ 10:33
Comment from: Sebastian P.R. Gingter [Visitor] · http://www.thespicemustflow.de
Would you mind to put the server part with the sample too? Let's say modified that it only sends data from a single test-table from a configurable database? Just to see how DA works on both sides. Or do you have some samples about that already? (Didnt had enough time to take a look at the trial by now).
PermalinkPermalink 09/11/07 @ 09:39
Comment from: marc hoffman [Member] Email
Sebastian,

well. the server is a standard run-of-the-mill DA/Delphi server, no code, just a schema defined in SM. But we'll consider providing it anyways (but it wont run, since we obviously can't allow direct connections to our production bug database...
PermalinkPermalink 09/11/07 @ 09:45
Comment from: Sebastian P.R. Gingter [Visitor] · http://www.thespicemustflow.de
Any chance to get a sql file to create a matching table in an own db or anything...?

Hrm. I definetly need to get myself some time for playing around with DA.
PermalinkPermalink 09/11/07 @ 16:26
Comment from: marc hoffman [Member] Email
Sebastian: possibly, yes. this is a standard Mantis MySQL database, btw.

Although our bug client bears little resemblance to Mantis anymore, thats still the back-end currently (in fact the above ap is te first to access the DB directly, rather thru Mantis's SOAP interface).
PermalinkPermalink 09/11/07 @ 18:00
Comment from: Rogério Araújo [Visitor] Email · http://faces.eti.br
Very good start! Now we have the main developer of Chrome enjoying the potential of Mono runtime!
PermalinkPermalink 09/29/07 @ 15:34

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

 

marc hoffman

Chief Software Architect &
Spare-time Photographer

mh

Links

Twitter

marc hoffman (follow)
    loading...
Mike Orriss (follow)
    loading...

Navigation

XML Feeds 

Who's Online?

  • Guest Users: 6