新经济地理

空间信息技术与区域经济
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Mono 2.0终于发布了

Posted on 2008-10-14 15:18  wuxb  阅读(518)  评论(1编辑  收藏  举报

    如果你是一个忠实的.NET爱好者,但是又很羡慕Java的跨平台特性,那么这里将告诉你一个非常棒的消息:2008年10月6号,Mono Project终于发布了一个里程碑式的重要作品:Mono 2.0。简单地说,Mono是.NET Framework的非微软实现,这意味着你的C#程序将可以运行在Unix、Linux、Solaris、MacOS等主流的操作系统上,而基本上无需修改。虽然在实际的设计中还有一些困难,但是Mono 2.0为此迈出了重要的一步,因为其带来了很重重要的特性,大部分是与Windows的.NET保持兼容。Mono 2.0支持的语言有很多:C# 2/3,Java、Boo、PHP、Javascript、Python等等,当然最重要的是C#,全面兼容C# 2.0和部分3.0的特性,比如支持C# 3的表达式树和LINQ等,也就是说Mono 2.0中实现了C# 3.0的编译器,其默认的C#编译器由mcs改为gmcs。下面看看其主要的亮点:

1、与Windows兼容的API

•  ADO.NET 2.0 API for accessing databases.
•  ASP.NET 2.0 API for developing Web-based applications.
•  Windows.Forms 2.0 API to create desktop applications. 完全实现了.NET 2.0中的常用控件:ToolStrip/MenuStrip/StatusStrip/ContextMenuStrip。            一个数据空间:DataGridView,一个Web控件:WebBrower,这个控件是基于Mozilla的Gecko HTML渲染引擎开发的,而不是IE。
•  System.XML 2.0: An API to manipulate XML documents.
•  System.Core: Provides support for the Language Integrated Query (LINQ).
•  System.Xml.Linq: Provides a LINQ provider for XML.

•  System.Drawing 2.0 API: A portable graphics rendering API.

2、Mono特有的API

• Gtk# 2.12: A binding to the Gtk+ 2.12 and GNOME libraries for creating desktop applications on Linux, Windows and MacOS X.
• Mono.Cecil: A library to manipulate ECMA CLI files (the native format used for executables and libraries).
• Mono.Cairo: A binding to the Cairo Graphics library to produce 2D graphics and render them into a variety of forms (images, windows, postscript and PDF).
• Mono's SQLite support: a library to create and consume databases created with SQLite.

• Mono.Posix: a library to access Linux and Unix specific functionality from your managed application. With both a low-level interface as well as higher level interfaces.

3、Mono中的第三方API

 • Extensive support for databases: PostgreSQL, DB2, Oracle, Sybase, SQL server, SQLite and Firebird,对主流的数据库提供了支持.

 • C5 Generics Library: we are bundling the C5 generics collection class library as part of Mono.

     其实从Mono的官网(其随2.0的发布也全面改版了:http://www.momo-project.org)介绍中可以知道,借助Mono 2.0可以将很多C#的程序从Windows平台轻易地移植到Linux中,只要C#代码中不涉及类似P/Invoke之类的跟操作系统相关的代码。当然实际运用中应该还有很多问题,但是我们有理由去克服,如果你喜欢C#的话。Mono的御用开发工具是MonoDevelop,这是从Windows下的SharpDevelop发展而来,同样是非常棒的一个作品,目前的版本是2.0的Alpha版本。

     最后,感谢Mono Project小组,感谢那些开发人员为C#的爱好者提供了一个如此伟大的作品。