This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
n Mono means “Monkey” in Spanishn Not a product: a technology toolkit for developers
§ Compilers § Common Language Runtime (CLR) Virtual Machine§ Set of libraries
n Mono is a Free Software/Open Source implementation of:§ Common Language Infrastructure§ C# Compiler§ ADO.NET & ASP.NET for web application and web services development § Set of APIs (.NET and Linux/Gnome bindings)
n Mono's .NET implementation is based on the ECMA standards for C# and the Common Language Infrastructure
n Sponsored by Novelln Begun by Miguel de Icaza – lead developer of GNOME
n Today ISVs do not know what development environment to use to port their software to Linux
n Mono through .NET and C# provides them with a clean implementation that leverage competences they’re most likely to have in house. Linux appears less foreign
n A great alternative to C-based SDKs available for Embedded systems and PDAs
n Cross language interoperabilityn Secure runtime environmentn Detailed and complete class librariesn Extensibility
n Deployment toolsn Integrated web servicesn Over C/C++§ Security§ Class libraries§ Reflection
n Over Java§ Multiple languages§ Better GUI performance and appearance§ Code Access Security
Introduction to Mono March/April 200512
Mono 1.0 Contents
n In July 2004, the Mono community released Mono 1.0, which included the following features:§ C# compiler§ VM, with JIT and pre -compiler§ IL assembler, disassembler§ Development and security tools§ Core libraries: mscorlib, System, System.XML§ Unix and open source bindings (GTK#, Mozilla#, ZipLib, …)§ System.Data and Mono database providers§ System.Web: Web applications platform§ System.Web.Services: client and server support§ Embedding API
n Mono 1.0: July 2004§ Implement .NET 1.0 and 1.1 APIs§ Core, ADO.NET, ASP.NET, C# 1.0§ MonoDoc
n Mono 1.2: 2Q2005§ Add C# 2.0§ Add ASP.NET 2.0§ Adds XML 2.0§ .NET 1.0, .NET 1.1 and .NET 1.2 APIs
n Mono 2.0: 2Q2006§ A complete implementation of .NET 2.0 features as well as
updates to Mono exclusive APIs
Introduction to Mono March/April 200514
Current Release – 1.1.4
n Code Access Security (CAS) support:§ Policy resolution - including assembly-level RequestMinimum,
RequestOptional and RequestRefuse attributes§ Declarative/Imperative demands§ Declarative stack modifiers (Assert, Deny and PermitOnly)
n Cryptographic performance improvements
n ASP .NET 2.0 features
n New implementation of Windows.Forms
n XML .NET 2.0:§ XmlSchemaValidator is implemented. As well, significant
refactoring on XML Schema validating reader has been done§ SchemaInfo on DOM is now provided§ There is new support for reading Binary content: Base64/BinHex
n A new statistical profiler is included in the default Mono profiler
n Performance enhancements:§ Exception throwing is now a lot faster § SSA-based partial redundancy elimination has been updated.
Work on Alias Analysis is being done to enhance this optimization§ Array Bounds Check (ABC) Removal removes more checks§ Many System.Threading.Interlocked operations are implemented
using inline assembly for the x86§ Various peephole and Linear Scan improvements have been
made to increase code quality§ Throw blocks are now placed in an out-of-bound block to improve
locality and branch prediction§ Remoting for TCP and HTTP transport is vastly faster now (few
orders of magnitude) § A more scalable threadpool for remoting for incoming
connections.
Introduction to Mono March/April 200516
Current Release – 1.1.4
n Memory Usage Improvements:§ Many metadata structures are now delay-loaded, reducing
memory consumption, especially in long running GUI applications§ Memory leaks have been audited, especially in terms of
application domain unloading§ The symbol file for --debug is now loaded with mmap, reducing
memory consumption by a few megabytes§ XmlDocument and its helper classes now use less memory.
n C# 2.0 features:§ Anonymous methods § Iterators§ Partial classes§ Static classes§ Covariance and contra -variance § Property accessor accessibility § Inline warning control
n Common Language Infrastructure§ JIT converts the intermediate language into native code
n Multiple language interoperability§ C++, C#, JavaScript, Visual Basic, Eiffel, Ada, COBOL, Pascal, C
n A new language: C#§ VERY similar to Java
n Class Libraries
n Benefits:
§ Advanced platform for end-user application development§ Multiple language support§ Interoperability (SOAP, .NET)§ Grants access for Window ISVs to UNIX
Introduction to Mono March/April 200518
Mono and Eclipse
IKVM.NET is an implementation of Java for Mono and .NET Framework. It includes:§ A Java Virtual Machine implemented in .NET§ A .NET implementation of the Java class libraries§ Tools that enable Java and .NET interoperability
n ADO.NET stands for ActiveX Data Objects for .NETn It refers to the suite of data access technologies used to
manipulate databasesn Mono has many ADO.NET Data Providers to get you
connected:§ IBM DB2 Universal Database§ MySQL§ ODBC§ Oracle§ OLE DB§ PostgreSQL§ Microsoft SQL Server§ SQL Lite§ Sybase§ Older Microsoft SQL Server and Sybase databases
Introduction to Mono March/April 200520
ASP.NET
n Active Server Pages - Microsoft's IIS-based server side scripting architecture
n ASP.NET support is divided in two pieces:
§ Web Forms (Web Applications infrastructure)§ Web Services (the SOAP-based RPC system)
n Using ASP.NET System.Web.Hosting namespace classes you can make your own ASP.NET enabled server
n Or use two provided methods:
§ XSP: A light-weight web server written in C#§ mod_mono: An Apache plug-in module that works with both 1.3
void Page_Load (object o, EventArgs e) {if (!IsPostBack) {
ArrayList list = new ArrayList ();list.Add (new Datum ("Spain", "es", "Europe"));list.Add (new Datum ("Japan", "jp", "Asia"));list.Add (new Datum ("Mexico", "mx", "America"));dg.DataSource = list;dg.DataBind ();
TestService service = new TestService();result = service.Add(100,200);Console.WriteLine("{0}",result.ToString());Console.WriteLine(service.Echo("String of characters"));
///Web service that can make currency conversions///</remarks>[System.Web.Services.WebServiceBinding(Name="ConverterServiceSoap",Namespace="http://tempuri.org/"),System.Diagnostics.DebuggerStepThroughAttribute(),System.ComponentModel.DesignerCategoryAttribute("code")]public class ConverterService : System.Web.Services.Protocols.SoapHttpClientProtocol {
public UserInfo UserInfoValue;
public ConverterService () {this.Url = "http://resc011/demo/ConverterService.asmx";
}
/// <remarks>///Registers the user into the system///</remarks>
''' <remarks/>''' <remarks>Web service that can make currency conversions</remarks><System.Web.Services.WebServiceBinding(Name="ConverterServiceSoap",Namespace="http://tempuri.org/"),System.Diagnostics.DebuggerStepThroughAttribute(),System.ComponentModel.DesignerCategoryAttribute("code")> _Public Class ConverterService
Public Sub Login(a As String)Me.Invoke("Login", New Object {
a})End Sub
Introduction to Mono March/April 200534
Interfacing to Existing Services…
n Experimental Adabas Interface§ Provide a “data -orientated” view to programmer§ Implement direct call interface§ Hide low-level control block and buffer interactions§ Programmer only interacts with fields§ Similar in concept and operation to our “Jadabas” product
n Next steps§ Extract field names from DDM§ Automatically generate C# code from DDM information§ Result: C# code that can be included by programmers to access
and update an Adabas database
Introduction to Mono March/April 200538
Just-in-Time Compilers
n Available for:§ x86§ amd64§ PowerPC§ Sparc§ s390 (32-bit)
SSA based partial redundancyssapreArray bound checks removalabcremPre-compile all methods before executing mainprecompUsage of Ahead of Time compiled codeaotLeaf procedures optimizationsleafFast x86 FP comparesfcmovLoop related optimizationsloopTail recursing and tail callstailcIntrinsic method implementationintrinsInstruction schedulingschedEmit per-domain codesharedConditional movescmovLinear scan global register allocationlinearsDead code eliminationdeadceCopy propagationcopypropConstant propagationconspropConstant foldingcfoldInline method callsinlineBranch optimizationbranchPeephole PostpasspeepholeDescriptionOptimization
Introduction to Mono March/April 200540
S/390 Just In Time Compiler (JIT)
n 32-bit
n zSeries only
§ Uses “N3” instructions like LARL/BRCL§ Use interpreter for non z -boxes (although development has
ceased on the interpreter)
n Bytecodes compiled as required:§ Class loaded§ “Trampoline” created§ Code compiled§ Control passed to compiled code
n Efficient for things more complex than “Hello World”
n Will compile code only used once
§ May result in more overhead than interpreter§ Unlike “Hotspot” compiler Sun uses for Java