1 / 59

Mono: Rapid GUI Application Development On Linux

Antony
Download Presentation

Mono: Rapid GUI Application Development On Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. Mono: Rapid GUI Application Development On Linux Karl Bunnell Software Engineer Consultant, Novell Inc. kbunnell@novell.com

    2. The one Net vision This represents our one Net vision. As a company, we are committed to providing solutions to your business problems based on the fulfillment of this strategic framework. Since we announced one Net in 1999, we have been working to identify and develop the technologies, products and solution suites that make the vision a reality for our customers. One Net brings you closer to a world where networks of all types work together seamlessly, so you can connect employees, customers, suppliers and partners across organizational boundaries and give them faster, easier and more secure access to all the information and resources they need, when and where they need it. And our fulfillment of the one Net strategic framework translates directly into business solutions that offer more opportunity, higher ROI and closer, more productive relationships with you and everyone who matters to your business. Lets take a brief tour of one Net to help set the context for our discussion today. Starting in the center, our Ngage teams employ proven methodologies and expertise, training, and support at all levels of your organization to facilitate the design, development and deployment of secure, scalable business solutions. Novell exteNd, our integrated development environment for the creation of Web services-based solutions help transform rigid silo applications into personalized, standards-based, process-driven secure Web solutions. Novell Nsure, our secure identity management solutions family, delivers your enterprise resources and business information based on who people are and what they need, wherever they need it. Novell Nterprise, our cross platform network services suites, add invaluable capabilities to all kinds of mixed networks and diverse infrastructures. Nterprise solutions are the embodiment of this philosophy. We will deliver and support the services on the platforms our customers and the market demand. Today and in the foreseeable future, Linux running on Intel is the platform the market and our customers are demanding. This represents our one Net vision. As a company, we are committed to providing solutions to your business problems based on the fulfillment of this strategic framework. Since we announced one Net in 1999, we have been working to identify and develop the technologies, products and solution suites that make the vision a reality for our customers. One Net brings you closer to a world where networks of all types work together seamlessly, so you can connect employees, customers, suppliers and partners across organizational boundaries and give them faster, easier and more secure access to all the information and resources they need, when and where they need it. And our fulfillment of the one Net strategic framework translates directly into business solutions that offer more opportunity, higher ROI and closer, more productive relationships with you and everyone who matters to your business. Lets take a brief tour of one Net to help set the context for our discussion today. Starting in the center, our Ngage teams employ proven methodologies and expertise, training, and support at all levels of your organization to facilitate the design, development and deployment of secure, scalable business solutions. Novell exteNd, our integrated development environment for the creation of Web services-based solutions help transform rigid silo applications into personalized, standards-based, process-driven secure Web solutions. Novell Nsure, our secure identity management solutions family, delivers your enterprise resources and business information based on who people are and what they need, wherever they need it. Novell Nterprise, our cross platform network services suites, add invaluable capabilities to all kinds of mixed networks and diverse infrastructures. Nterprise solutions are the embodiment of this philosophy. We will deliver and support the services on the platforms our customers and the market demand. Today and in the foreseeable future, Linux running on Intel is the platform the market and our customers are demanding.

    3. The one Net vision This represents our one Net vision. As a company, we are committed to providing solutions to your business problems based on the fulfillment of this strategic framework. Since we announced one Net in 1999, we have been working to identify and develop the technologies, products and solution suites that make the vision a reality for our customers. One Net brings you closer to a world where networks of all types work together seamlessly, so you can connect employees, customers, suppliers and partners across organizational boundaries and give them faster, easier and more secure access to all the information and resources they need, when and where they need it. And our fulfillment of the one Net strategic framework translates directly into business solutions that offer more opportunity, higher ROI and closer, more productive relationships with you and everyone who matters to your business. Lets take a brief tour of one Net to help set the context for our discussion today. Starting in the center, our Ngage teams employ proven methodologies and expertise, training, and support at all levels of your organization to facilitate the design, development and deployment of secure, scalable business solutions. Novell exteNd, our integrated development environment for the creation of Web services-based solutions help transform rigid silo applications into personalized, standards-based, process-driven secure Web solutions. Novell Nsure, our secure identity management solutions family, delivers your enterprise resources and business information based on who people are and what they need, wherever they need it. Novell Nterprise, our cross platform network services suites, add invaluable capabilities to all kinds of mixed networks and diverse infrastructures. Nterprise solutions are the embodiment of this philosophy. We will deliver and support the services on the platforms our customers and the market demand. Today and in the foreseeable future, Linux running on Intel is the platform the market and our customers are demanding. This represents our one Net vision. As a company, we are committed to providing solutions to your business problems based on the fulfillment of this strategic framework. Since we announced one Net in 1999, we have been working to identify and develop the technologies, products and solution suites that make the vision a reality for our customers. One Net brings you closer to a world where networks of all types work together seamlessly, so you can connect employees, customers, suppliers and partners across organizational boundaries and give them faster, easier and more secure access to all the information and resources they need, when and where they need it. And our fulfillment of the one Net strategic framework translates directly into business solutions that offer more opportunity, higher ROI and closer, more productive relationships with you and everyone who matters to your business. Lets take a brief tour of one Net to help set the context for our discussion today. Starting in the center, our Ngage teams employ proven methodologies and expertise, training, and support at all levels of your organization to facilitate the design, development and deployment of secure, scalable business solutions. Novell exteNd, our integrated development environment for the creation of Web services-based solutions help transform rigid silo applications into personalized, standards-based, process-driven secure Web solutions. Novell Nsure, our secure identity management solutions family, delivers your enterprise resources and business information based on who people are and what they need, wherever they need it. Novell Nterprise, our cross platform network services suites, add invaluable capabilities to all kinds of mixed networks and diverse infrastructures. Nterprise solutions are the embodiment of this philosophy. We will deliver and support the services on the platforms our customers and the market demand. Today and in the foreseeable future, Linux running on Intel is the platform the market and our customers are demanding.

    4. Agenda .NET Overview Mono Overview Lab Exercises that implement simple technologies on Linux Platform

    5. What is .NET? Microsoft .NET is a vision, or marketing strategy, as well as new technologies A brand applied to: Several new technologies .NET Framework Mono is an implementation of the .NET Framework New releases of old technologies Several old technologies Most significant new technologies Common Language Runtime (CLR) / Common Language Infrastructure (CLI) Web Services

    6. .NET Platform

    7. The .NET Framework Managed, typesafe environment for the development and execution of applications. Previously only available on Windows, now available on Linux. The .NET Framework consists of the following two components: Common Language Runtime (CLR) Manages code execution Provides core services Enforces safety and security restrictions .NET Framework class library Collection of useful and reusable types that integrate with CLR

    8. .NET Framework

    9. The .NET Framework Benefits Language Independence Write an application in any supported language (C#, Monobasic, etc) and its classes can be shared with an application written in any other supported language. Platform Independence Like Java, .NET code is not compiled to machine code but to an intermediate byte format (CIL). Hence, anywhere the interpretive engine exists the application can run. Class Library Extensive class library that includes support for many/most of the tasks needed for application development.

    10. The .NET Framework Benefits (cont.) C# Language Effective language patterned after Java, so it contains many of the strengths of both Java and C++ VB.NET Language More full-featured than previous versions of Basic. Basic classes can be used from other languages like C# Web Applications ASP.NET delivers on the promise of Web Services with implementation of technologies such as WSDL, SOAP, etc.

    11. The .NET Framework Class Library Object-oriented collection of reusable classes that provide many of the services needed to write an application All Framework classes are under the System namespace System.Collections System.Data database access and manipulation System.Data.SQLClient MS SQL Server specific System.IO File system handling System.Security permissions, cryptography, etc. System.Windows.Forms types for windows apps.

    12. The .NET Framework Namespace Logical, Hierarchical grouping of related classes Similar to a package in Java Access namespaces with: Imports Visual Basic .NET using C# using System.Windows.Forms

    13. Assemblies Physical packaging of the class libraries Typically built as a .dll file. However, dont confuse them as being a Win32 shared library An Assembly Manifest is Metadata that contains information about what an assembly contains Assemblies name and version Types exposed by the assembly Other assemblies required by the assembly Security instructions (permissions required and denied) .NET runtime, tools, compilers etc. can all use this Metadata to find out all they need to know about .NET resources. Used for Reflection

    14. Common Language Runtime (CLR) Provides services to .NET applications (similar to JVM in Java) A set of libraries available to all .NET applications Manages memory Thread execution Code execution Type safety verification Compilation (Just In-time Compiler)

    15. Common Language Infrastructure (CLI) Subset of the CLR submitted to the European Computer Manufacturers Association (ECMA) standards organization so that a third-party vendor could implement a CLR for a platform other than Windows. Shared Source CLI (SSCLI) is a working implementation of the ECMA CLI. Submitted for standardization: C# Semantics for metadata Microsoft Intermediate Language (MSIL) Parts of the .NET framework class library

    16. Managed Code Code that is executed by the CLR. Managed code provides information (i.e., metadata) to allow the CLR to locate methods encoded in assembly modules, store and retrieve security information, handle exceptions, and walk the program stack. Managed code can access both managed data and unmanaged data. Managed dataMemory that is allocated and released by the CLR using Garbage Collection. Managed data can only be accessed by managed code.

    17. .NET Portable Execution File

    18. The Microsoft Intermediate Language (MSIL) Intermediate format that runs in the CLR Not a machine specific binary but an intermediate representation Must be converted by a .NET Framework just-in-time (JIT) compiler to native code

    19. MSIL Tools MSIL Assembler (Ilasm.exe) Generates executable from MSIL MSIL Disassembler (Ildasm.exe) Creates MSIL code from executable Native Image Generator Tool (Ngen.exe) Compiles MSIL to machine code in lieu of JIT compiler

    20. MSIL Hello World Assembler directives begin with a period MSIL instructions: lines 8, 9 and 10

    21. .NET Application Construction Write application in one of the many supported languages (C#, VB, C++, etc). All these languages conform to the Common Language Specification (CLS) Compile application into Microsoft Intermediate Language (MSIL or IL) Execute code within the CLR Since all compilers, tools and the CLR use the Common Type System (CTS) data can be transferred between applications developed in different languages.

    23. Common Type System (CTS) .NET supports language integration, which means that you can inherit classes, catch exceptions, etc. across languages. This is possible because all .NET components must adhere to the CTS standard. All objects derive from root object System.Object CTS is a type system shared by compilers, tools and the CLR CTS supports two different types: Reference (heap allocation) Value (stack allocation)

    24. Common Language Specification (CLS) The goal of .NET is to support language integration BUT - not all languages are the same Some are case sensitive, others are not, etc. CLS is a specification that identifies a base set of rules that are required for language integration. Languages must support CLS to be compliant with the .NET Framework Essentially CLS is a contract between language designers and the .NET Framework

    25. NNET Languages The CLR was designed to support multiple languages

    26. Mono An Open Source .NET Framework Implementation. Effort lead by Ximian, launched in July 2001 ~100 contributors, ~30 very active Status today: CLI compliant execution system. Just-in-time compiler on x86 systems. Multi-platform (Linux, Solaris, BSD, Windows) C# compiler. Class Libraries: Most core functionality done. Various degrees of readiness at higher levels.

    27. Project Background Bring Open Source to the Desktop.

    28. Evolving GNOME

    29. Example Case

    30. The .NET Framework What we were looking for For Gnome, For Ximian Core standardized (VES + C# language) A virtual execution system (VES) Multiple language support Common subset for interop: CTS A large class library A new programming language: C# VES designed to interoperate with legacy code

    31. Mono Project Scope A change of direction Desktop -> Platform Bring the .NET Framework to Unix Allows easy migration of Windows to Unix. Develop with Visual Studio, deploy on Linux. Gives us much needed room to breathe. Goals: Virtual Execution System C# compiler Class Libraries compatible with .NET Framework

    33. Lab: Install Mono Runtime Source Install At minimum you need: Pkg-config: http://www.freedesktop.org/software/pkgconfig Glib 1.3: ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz Source Tarball (e.g. mono-0.28-1.src.rpm ) http://www.go-mono.org/download.html Then: autogen.sh ; ./configure ; make ; make install RPM (Red Hat Package Manager) Install Binary rpm (e.g. mono-0.28-1.ximian.6.1.i386.rpm ) http://www.go-mono.org/download.html rmp -ih mono-0.28-1.ximian.6.1.i386.rpm Use RedCarpet

    34. Use RedCarpet to Install Mono

    35. C#.NET Programming Language An object-oriented and type-safe programming language supported by Microsoft for use with the .NET Framework. C# (pronounced "see-sharp") was created specifically for building enterprise-scale applications using the .NET Framework. It is similar in syntax to both C++ and Java and is considered by Microsoft as the natural evolution of the C and C++ languages. C# was created by Anders Hejlsberg (author of Turbo Pascal and architect of Delphi), Scot Wiltamuth, and Peter Golde. C# is defined by the standard ECMA-334

    36. C# vs. Java Similarities Single rooted class hierarchy C# - System.Object Java java.lang.Object Mostly similar keywords Managed Execution Environments (CLR, JVM) Heap based classes and Garbage Collection Subarrays of multi-dimensional arrays can vary in size All methods must be a member of a class (unlike C) Interface support Strings are immutable Unextendable classes (sealed, final) Exceptions are thrown and caught Class member initialization

    37. C# vs. Java Slight Differences C# - Main vs. Java - main (C# Main can have void parameter) Inheritance (: vs. extends and implements) C#s is vs. Javas instanceof Namespaces vs. packages (in C# namespace names do not identify directory Constructors, C# destructors vs. Java finalizers Synchronizations of methods and code blocks (a) Synchronized vs. lock (code blocks) (b) Java public synchronized void ourMethod(void) C# - [MethodImpl (MethodImplOptions.Synchronized)] Public void OurMethod(void) Access Modifiers: private(default) private, public public, internal -protected(default), protected N/A, internal protected N/A) Const (compile time), readonly(run time) vs. final(both)

    38. C# vs. Java Slight Differences (cont.) Array declarations (int iArray[] wont compile in C#) base vs. super for calling base class constructor C# has static nested class but no inner class equivalent Threads Exist in both but instantiated and run differently C# has no fall-through in switch statement Assemblies vs. JARs Collections (Java is considered to be more sophisticated) Documentation XML vs. HTML Multiple classes in a single file (multiple public classes) Importing Libraries (import vs. using, -classpath vs. /r) Cross Language Interoperability (JNI vs. CLS)

    39. C# vs. Java Unique Things in Either C# or Java C# - System.IDisposable interface C# - Delegates C# - Enumerations C# - Value types (may be stack based in C#) C# - as operator for dynamic casting C# - foreach statement C# - attributes C# - Pass by reference

    40. Lab: Become Familiar with C# Using monodoc read the sections indicated by the red box ---> What c# construct would you use to organize c# classes? (hint: similar to Java packages) When you compile a c# application what does it compile to? What tool do you use to compile a c# application? What tool do you use to run a c# application?

    41. Lab: Compile a C# Application Using monodoc navigate to -> Read the section on Using the C# Compiler and complete the associated exercise. At the cmd prompt type: monodis hellocs.exe --output=hellocs.il At the cmd prompt type: vi hellocs.il What is the hellocs.il file?

    42. Objective: Compile VBasic Application Using monodoc navigate to -> Read the section on Using the VB.NET Compiler and complete the associated exercise. At the cmd prompt type: monodis hellovb.exe - output=hellovb.il Compare hellovb.il to hellocs.il from the previous exercise. Are they the same? What are the differences?

    43. Objective: Compile IL Code Using monodoc read the sections indicated by the red box --> At the cmd prompt type: mono/usr/bin/ilasm.exe --help Use ilasm.exe to compile hellocs.il & hellovb.il. (hint: ilasm.exe is a .Net application) What specification enables the support of multiple programming languages within .Net?

    45. GUI classes: Gtk# Gtk# is Ximian's main interest For Gnome Purposes It is also easy, most stuff is already there. We have plenty of in-house expertise. Benefits our products directly. Works on Windows as well. Mphoto.

    46. Windows.Forms Current strategy: Use WineLib to implement it. Reduces time of development. Need it to be Wndproc/PInvoke compatible. Implement alternate render engines in Wine: Gtk on X11 Cocoa on MacOS X Reasons: Major interest in getting it done. Third party developers focused on it. Second most requested Mono feature.

    47. ASP.NET WebForms Component-based Web programming. Most requested Mono feature. Develop on Windows, deploy on Unix. ASP.NET: XSP parser. Finished the HttpRuntime infrastructure recently. Can run as a cgi-bin in most servers. Deep integration with Apache coming soon. Limited to C# for the server-side-scripts

    48. What is gtk+ GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets gtk.org

    49. GTK+ Libraries

    50. GTK+ Uses Widgets

    51. GTK+ Basics

    52. GTK+ Basics (cont.)

    53. Widget Life-Cycle

    54. Objective: Become Familiar with GTK# Using monodoc read the sections indicated by the red box --> Complete the gtk# Hello World exercise. What does 'GTK' represent? What is the origin of the GTK?

    55. Objective: Become Familiar with GTK# Samples

    56. Objective: Become Familiar with GNOME# Using monodoc read the sections indicated by the red box --> Complete the gnome# Hello World exercise. When would you use gnome# vs gtk#? Is there any advantage to using one over the other? (hint: read 'Introduction' sections.)

    57. Objective: Become Familiar with Glade# Using monodoc read the sections indicated by the red box --> Complete the associated Glade# exercise. Compile the Glade# sample to include the Glade- xml file as an embedded resource. (hint: read last paragraph in the section) Use the Interface Designer to create your own GUI application.

    58. Resources EMCA filing of CLI and C# http://www.ecma.ch/ecma1/STAND/ecma-335.htm The Mono Project homepage http://www.go-mono.com/ The dotGNU hompage http://www.dotgnu.org Microsoft's .NET Homepage http://www.microsoft.com/net

More Related