Cross Platform Programming

Published Sun, Oct 24 2004 17:54 | William

Just to give you an update on the project ----- so far, it looks like Portable .NET is going to be the weak link.  I'm not criticizing it, but the implementation is a little small compared to Mono and obviously the full framework.  I am not in any ways or by any means 'qualified' to say what can't be done with it because prior to last week, I hadn't looked at it.  I'm fairly familiar with Mono (which is impressive) but my Linux game is mud and I haven't found too many Linux wizards that I can go to for help.  Found a lot of guys that can recompile their kernels but other than that, getting help setting up Samba to work correctly got me nowhere.  And to be honest, if I can get Samba running but some guru capable of rebuilding his kernel can't, his guru status is a big question mark.  Anyway,  my point was that I've never used a Mac until this last week (well, I had a Lisa and a IIE but I don't think that counts) and any deficiencies I come across in Mono are probably due to deficiencies in me, not Mono.  That's the story until I get a lot more familiar with it anyway.

I don't see Remoting support the http://www.dotgnu.org/pnetlib-doc/ for Portable .NET but that doesn't mean it's not there or not in the works.  (Geez Bill, can't you find a way to say you don't know what the hell you're doing in less than 200 f******  words).  Well,actually no.  In order to really discuss this stuff you need to compare all three and not knowing ofe of them kind of hinders that.  So far though, I have been able to get the WS stuff to work with each build.  That seems like the easiest of the bunch though. 

Next, I'm going to change the strategy.  First pass will simply be remoting something from Windows to Linux.  Then I'll use a WS to transfer the data over to the mac.  Not exactly what I wanted to do but I have to compromise for the moment.  Another issue is heading over to dotgnu.  It's a weee bit too Anti-Microsoft for my taste and when I see this sort of stuff, well, it reminds me of the type of people I've known that  usually talk like this.  Big, fat, long hair, a bunch of stupid tatoos and earrings, wearing black w/ a graphix bong next to the TV.  In the back of my head is this continual drumming of “Do you really want to ever hang out with these people?”  Then I tell myself that my impression was created using a pretty broad brush and that's certainly not the norm.  Oh well

Anyway, I think I have the Mono Scenario under control - got a long way to go with Portable .NET.  If anyone out there is using Portable .NET, please drop me a line - would love to run a few things by you.

Filed under: ,

Comments

# William said on October 24, 2004 11:47 PM:

Heh, cross platform development is like being bi-sexual. The final conclusion is more or less the same but, it's uncomfortable for at least one of the two, the experience doesn't have the same quality depending on the platform, the end user doesn't always get the same experience in both places, and somebody generally gets f#cked in the @ss. Then both parties blame the other for being non-standard.

# William said on October 25, 2004 12:37 PM:

Ok, before I know what you mean let me make it abundantly clear that I have no firsthand knowledge of the downside of being bi ;-). But yes, you're right, the User experience is totally different from what i can tell. So if you just use it for back end components then you really didn't do much b/c well, a lot of times people would want the app to run with a UI on both machines before considering it 'cross platform'. If you use it for front end development - well, it's weird. Havent' seen an Infragistics Port to Linux yet ;-).

I want to just get the back end processing working and be able to do it quickly b/c I'm hearing more and more "We don't want anything Microsoft directly exposed to the internet." So while Apache runs on windows and ASP.NET runs on Apache, that won't fly with a lot of folks as I'm finding out. So screw it, the business layer can sit outside the DMZ running on Linux, the DALC layer can run inside the DMZ running on Windows, there's no direct exposure of anything Microsoft to the internet and everyone will be happy. Currently that can be done with WS but Remoting definitely seems a lot faster.

I'm amazed at how many people think that Software alone dictates security, vs how you implement it. One of my friends who's just confronted this was telling me that the same people that made this demand had the company name as the Root password on the web server. And although I think most security problems are caused by people - MS has done some damage to itself b/c whenever you say IIS most people make some sort of Security related joke.

So if Cross platform development is like being Bi- what sort of development is equivalent to being a straight guy with two bi-women? It's definitely not compact framework development ;-).

# William said on October 25, 2004 2:01 PM:

straight guy with two bi-women? - The straight guy is an ISO standard C++ compiler and the two girls are two fully ISO standard implementations of the Standard Template Library. Compilation is worry free and the end result is amazing.

# William said on October 27, 2004 4:38 PM:

Hi Bill,
you might want to look at our site, www.remobjects.com, as we already have a solution that works cross platform (Win32 Delphi, .Net, Linux, soon Java) and **also** on Mono/Rotor.

Regards,
Alessandro Federici

Chief Architect Designer
www.remobjects.com

# William said on November 9, 2004 2:24 AM:

Cross Platform Programming
One area where class libraries really come into their own is in enabling you to write your programs in such a way as to allow them to be run on multiple operating systems without having to change any of your own code for any specific platform. This can be done with class libraries and still preserve the use of the individual operating system's native routines.

How is this done? Well all of the common functionality such as reading from the keyboard and mouse, writing to the screen, etc. need to be concealed within classes in your class library. You create identically named classes for each operating system that you want to support that call that operating system's in-built functions or where the operating system doesn't have the specific function built in you write the necessary code to perform that function in a way that the operating system does support. Each of these identically named classes will need to be stored separately in locations that identify which operating system that they are for.

Once you have built identical libraries of all of the routines that you need for each of the operating systems that you want to support you can compile each of these libraries separately using the appropriate compiler for the individual operating system so as to produce a collection of class library modules that contain identical functionality for each of your operating systems.

All of your programs can now be written so as to call the classes that you have in these operating specific libraries whenever they need to perform any of the functions that the operating system may provide. Because you have coded identically named routines with the appropriate functionality for each operating system you no longer need to know which operating system that you are coding for when you write your code. You have successfully concealed all of the operating system specific processing within these class libraries.

Now all that you need to do when compiling your program for the different operating systems is to link in the appropriate library of operating system routines that corresponds to the operating system that you are compiling for. All of the rest of the modules that your program needs to link in are now operating system independent and you can link in the same source code for each operating system that you are developing for. The only thing that you need to watch for now is to make sure that your modules have all been compiled for the correct operating system when you make your program as with a given module having a single name, only one object compiled from this code will exist at any given time and this will be for whichever operating system that you last compiled it for which may not be the same operating system as you are now trying to make your program. To resolve this you should ensure that all of your program modules get recompiled when you switch the operating system that you are compiling for rather than just the ones where you have made changes.

Of course you don't really need to go to the trouble of building your own class library that will make your programs operating system independent because someone else has already done this for you. Several of the class libraries listed on my page What is a Class Library? have pre-built libraries for DOS text, DOS Graphics, Windows 16 bit, Windows 32 bit, OS/2, Mackintosh, Unix Curses, Unix Motif, and a range of other operating systems so that once you have purchased the modules for those operating systems that you want to support you can proceed straight into writing operating system independent programs. If you later decide that you want to support an additional operating system then you just purchase the additional module and recompile to produce a finished program.

Search

This Blog

Tags

Community

Archives

News

My other sites

Cool Stuff

Book Stuff

Security

ORM

Data Access

Funny Stuff

Compact Framework Stuff

Web Casts

My KnowledgeBase Articles

My MVP Profile

Design Patterns

Performance

Debugging

Remoting

My Fellow Authors

My Books

LINQ

Misc

Speech

Syndication

Email Notifications