Welcome!

Linux Containers Authors: Liz McMillan, Elizabeth White, Zakia Bouachraoui, Pat Romanski, Stefana Muller

Related Topics: Linux Containers

Linux Containers: Article

Bringing the CLI to Open Source

Ximian's Mono Project means you have a choice

Those who like .NET may find themselves lamenting, "I still have to deploy applications on the Windows operating system. I am still locked to one vendor - Microsoft." If this sounds like you, Ximian's Mono project might be the answer. The Mono project was started in July 2001 by Miguel de Icaza, cofounder of Ximian, with the aim of bringing the Common Language Infrastructure platform to free systems.

Mono is an open source implementation of the Microsoft .NET Framework. It has a compiler for C#, an ECMA-compatible runtime engine for the Common Language Infrastructure, and class libraries. Mono implements various technologies developed by Microsoft that have now been submitted to the ECMA for standardization. The Mono project enables building and deploying cross-platform .NET applications. For example, a solution created using C# can be executed in Windows 2000 and also in Linux, Windows, Solaris, FreeBSD, HP-UX, and Mac OS X using Mono.

Architecture
Mono's core components are shown in Figure 1.

 
  • C#, logo, and basic compiler: These compilers generate code in a Common Intermediate Language (CIL), which is an intermediate representation of a compiled program and is easy to compile to native code using just-in-time (JIT) engines. Compiled code can be arranged in assemblies, which are a fundamental unit of deployment. The C# compiler is written in C# and is highly portable.
  • Class libraries: Mono includes a set of class libraries that can work with any language that works on Common Language Runtime. Core class libraries include collections, XML and Schema, database access, and file system access. These libraries use GNOME infrastructure components (GUI toolkit, XML libraries, CORBA implementation, printing architecture, and imaging system). The class library is structured into namespaces and deployed in assemblies. The top-level namespace for most of the .NET Framework is System.
  • Virtual machine: A virtual machine for the common intermediate language (CIL) byte codes is also included. It also has a JIT compiler for x86 CPUs. The Mono runtime provides CIL image loading, verification, and execution along with garbage collection, thread and I/O support, interaction with existing libraries (P/Invoke), and a security system.
Development
The good news about Mono is that you can choose from a variety of IDEs. You can use an open source IDE like Eclipse or #developer, a free IDE for C# and VB.NET projects on Microsoft's .NET platform. Eclipse is a very important project for future application development in this framework; it already has a basic C# plug-in that implements auto-indenting and syntax highlighting for this language. In addition, Eclipse can use the Gtk2 toolkit on GNU/Linux. This is great for GNOME users because it adapts better to the environment.

You can also use Visual Studio .NET, which provides great features for developing applications in C#. Programs written using Visual Studio .NET can be compiled and executed using Mono.

Other tools available to help in developing with Mono are NUnit, NAnt, NGen, and the Mono debugger. NUnit is a unit-testing framework for all .NET languages. Initially ported from JUnit, the current version, 2.1, is the second major release of xUnit-based unit testing tools for Microsoft .NET. It is written entirely in C# and has been completely redesigned to take advantage of many .NET language features. NAnt is a free .NET build tool that's very much like Ant. NGen is under development and will create native images from a managed assembly. The Mono debugger's purpose is to help developers in debugging Mono applications.

Documentation of these tools is available in MonoDoc, a documentation browser.

Advanced Features

  • ASP.NET: Mono, together with Apache, brings ASP.NET to Linux . This has opened the market for creating ASP.NET controls for Linux developers as well. ASP.NET can currently be deployed using either XSP Web server or Apache Web server with mod_mono. Finally, Mono makes writing dynamic Web pages using C++ or Logo possible.
  • Web services: Mono implements the same set of classes that have been authored in the .NET Framework. Mono provides many tools that can expedite the development of Web services, such as "wsdl" to create a local class from a WSDL file, and an XML Schema definition tool to convert XSD to XDR, XML to XSD, XSD to dataset, XSD to classes, and classes to XSD.
  • ADO.NET: ADO.NET data providers like IBM DB2, Oracle, Microsoft SQL Server, Sybase, MySQL, ODBC, and OLEDB are available in Mono, but many other data providers are available through various open source projects. SAP DB, Informix, and FoxPro are some of the databases that are supported only via ODBC and OLEDB. Main tools for ADO.NET include SQL# command-line query and SQL# for Gtk#. SQL# is a command-line tool to test connection strings, execute SQL statements, and save output in a text, HTML, or XML file. SQL# for Gtk# is a graphical database query tool with a toolbar and menu for various tasks.
  • Windows forms: System.Windows is Microsoft's GUI toolkit shipped with the .NET Framework. Mono implements the Win32 API using wineLIB.
  • Security: Mono implements many assemblies that implement .NET Framework cryptography. Mono makes X.509 certificates, XML digital signatures, cryptographic algorithms, and code signing available in 100% managed code.
  • Mono for GNOME applications: GNOME is a popular multiplatform free desktop environment. Mono provides Gtk#, which can be used by C# to create GNOME applications.
Advantages
Mono provides language and platform independence. It supports GNOME, KDE, and Windows desktop environments. It allows writing applications in many languages, so existing modules written in many languages can be used to create new applications with less effort using contract/interface-based programming. Currently Java is not supported. It will be interesting to see if the Mono project supports Java in the future, which will allow using C# components in Java and vice versa. The Mono runtime supports XPCOM on Unix systems and COM on Windows. The embedded Mono runtime in applications makes it possible to call C functions from CIL and CIL functions from C code. Mono has rich libraries for cryptography, HTTP, networking, directory services, and others. Garbage collection and SOAP support are faster than Java, and SandBox provides better security. Because of all these features, Mono can play a major role in helping Linux succeed as a desktop operating system.

Mono supports ahead-of-time compilation to convert developers' code to native code, which is done in Microsoft with ngen.exe tool.

The Mono project integrates with open source projects like Apache and makes open source development easier. The Mono C# compiler is released under the terms of the GNU GPL; the runtime libraries are under the GNU Library GPL; and the class libraries are released under the terms of the MIT X11 license. This permits creating proprietary applications using Mono.

The Mono project community is also growing, which ensures quick bug fixes. Ximian support for the Mono project is expected to continue in the future.

Interoperability
Writing interoperable applications between Microsoft .NET and Mono will remain challenging because ASP.NET, ADO.NET, Windows.Forms, and many other higher-level blocks are not part of ECMA standard. Many .NET class libraries have not been implemented completely in Mono. This means that it is very likely that when Mono is released, applications written for .NET may not be portable to Mono.

Microsoft's .NET strategy includes many other efforts such as Windows applications; Passport-centralized, single sign-on systems, and others. These efforts are not part of the Mono project.

To make applications more interoperable:

  • Avoid use of Microsoft.* packages
  • Avoid absolute paths
  • Use 100% .NET assemblies
  • Use Gtk# rather than System.Windows.Forms
  • Do not use the Microsoft registry
Mono brings Microsoft and open source projects closer. Mono is new, and its success will depend on many other open source initiatives, including the Eclipse plug-in to compile the C# code using the Mono C# compiler, C# code generator (XSP) for ASP.NET, and so on. In the future, it will be interesting to see if C# developers will be able to use the Java API (Struts, log4J, etc.) to create an application and deploy it in J2EE application servers.

More Stories By Deepak Mittal

Deepak Mittal is a technology evangelist. His expertise is in automating business processes using workflow engines, Web services, e-form, data integration, business object modeling, and rule engines.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Moroccanoil®, the global leader in oil-infused beauty, is thrilled to announce the NEW Moroccanoil Color Depositing Masks, a collection of dual-benefit hair masks that deposit pure pigments while providing the treatment benefits of a deep conditioning mask. The collection consists of seven curated shades for commitment-free, beautifully-colored hair that looks and feels healthy.
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
We all love the many benefits of natural plant oils, used as a deap treatment before shampooing, at home or at the beach, but is there an all-in-one solution for everyday intensive nutrition and modern styling?I am passionate about the benefits of natural extracts with tried-and-tested results, which I have used to develop my own brand (lemon for its acid ph, wheat germ for its fortifying action…). I wanted a product which combined caring and styling effects, and which could be used after shampo...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
There are many examples of disruption in consumer space – Uber disrupting the cab industry, Airbnb disrupting the hospitality industry and so on; but have you wondered who is disrupting support and operations? AISERA helps make businesses and customers successful by offering consumer-like user experience for support and operations. We have built the world’s first AI-driven IT / HR / Cloud / Customer Support and Operations solution.
Codete accelerates their clients growth through technological expertise and experience. Codite team works with organizations to meet the challenges that digitalization presents. Their clients include digital start-ups as well as established enterprises in the IT industry. To stay competitive in a highly innovative IT industry, strong R&D departments and bold spin-off initiatives is a must. Codete Data Science and Software Architects teams help corporate clients to stay up to date with the mod...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Druva is the global leader in Cloud Data Protection and Management, delivering the industry's first data management-as-a-service solution that aggregates data from endpoints, servers and cloud applications and leverages the public cloud to offer a single pane of glass to enable data protection, governance and intelligence-dramatically increasing the availability and visibility of business critical information, while reducing the risk, cost and complexity of managing and protecting it. Druva's...
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.