Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java in Windows and MacOS

 
Mohamed anvar sithik
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai
I have written a java program in Windows platform. If i am going to
write the same program using java in Mac OS . Is we need to change any thing in the program to make it comapatible with Mac OS.

For eg., If my program in windows is going to refer the windows registry. But in Mac OS there is no concept of registry . How to make make it compatible for both OS.
 
Jason Kingsley
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use platform specific functionalilty, of which the Windows Registry is definately one, then you simply cannot use the the functionality "as is".

What you will have to do is abstract away the notion of the underlying mechanism. One way is to have your code talk to either an interface/abstract definition of the functionality that you want. Your other layers of code do not (should not) care about the underlying implementation. Then you can strategise the concrete implementation specific for the platform, it will then be easily extensible should you move to other platforms.

If you don't know about design patterns, you may wish to brush up on the famous patterns (by the "gang-of-four") to gain a better understanding of the mechanisms used and how you can apply them to your problem. Such things as these provide the logical solutions for such problems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic