230 likes | 376 Views
.NET. Johan Muskens Technische Universiteit Eindhoven. Agenda. Topics: Introduction to .NET. What is the .NET Framework?. Selling speech: The .NET Framework is the new library of classes that you use to build Windows applications.
E N D
.NET Johan Muskens Technische Universiteit Eindhoven
Agenda • Topics: • Introduction to .NET
What is the .NET Framework? • Selling speech: • The .NET Framework is the new library of classes that you use to build Windows applications. • The .NET Framework is a computing platform that has been designed to simplify the development of applications, such as: • Applications that use sophisticated GUI front ends • Applications that use Internet • Applications that are distributed over more than one computer • Applications that make sophisticated use of databases
What does .NET give you? • The .NET Framework provides the following to a developer : • Language independence • Standard building blocks (for GUI, Database, etc) • A way to create your own building blocks (assemblies) • Distribution of components • OS independence ???
Intermediate Language C++ code VB code • All .Net languages compile down into an intermediate form called Intermediate Language (IL). • IL is similar to Java byte code • Can not directly executed on target system • Portable • Always converted into native code (unlike • Java) by JIT compiler. • More than just low-level machine independent • object code. C++ compiler VB compiler IL code IL code IL provides cross language interoperability when you make some agreements
Common Type System AGREEMENT PART I • The Common Type System provides a specification for how types are • Defined • Managed • Used • This is important for cross-language integration! • The CTS provides rules that languages must obey, to ensure that types created in different languages can interoperate with one another.
CTS CLS Common Language Specification AGREEMENT PART II The Common Language Specification is a set of rules and constraints that compiler and library writers need to follow to be sure that the languages and code they produce will interoperate with other .NET languages. The Common Language Specification is a subset of the Common Type System. If language complies to CLS it can interoperate with other .NET languages
2 Main Components • There are two main components to the .NET Framework: • Common Language Runtime Language independence • The CLR is responsible for execution of IL-code within the .NET environment, providing services such as security, memory management and remoting. (managed and unmanaged code) • .NET Framework Class Library Standard building blocks • The .NET Framework Class Library is an library of classes that provides all the tools you need to write a wide variety of programs.
Metadata • .NET assemblies are self-describing, in that they carry descriptive information with them. This information, called metadata, includes the following information: • Name, version, and culture-specific information for the assembly • The types that are exported by the assembly • Dependencies on other assemblies • Security permissions needed to run • Information for each type in the assembly (name, visibility, etc) • Additional attribute information • Most of the metadata is created by the compiler when it produces IL.
Assemblies • Assemblies are the basic building blocks from which .NET applications are constructed, and are the fundamental unit of deployment and versioning. Assemblies are deployed as DLLs or Executables. • An assembly contains: • IL code • Metadata describing assembly and its contents • Files needed for run-time operation DLL or Executable IL Code Meta data RT operation RT operation RT operation Self contained
.NET Framework Namespaces • The classes in the .NET Framework Class Library are structured using namespaces. • A name space groups classes that implement related functionality • Namespaces make sure the Framework Class Library doesn’t get an • unorganized container of classes. … the next slides will present some example namespaces
IO Namespace • The IO namespace provides the classes that implement the .NET I/O functionality. • Example classes: • BinaryReader • BinaryWriter • Stream • StreamReader • StreamWriter • IOException • …
messagebox label1 label2 label3 button Forms Namespace • The Forms namespace provides the classes used for programming with forms. This namespace is huge (over 300 classes) • Example classes: • Application • Button • ComboBox • Panel • FileDialog • Form • …
NET Namespace • The NET namespace provides the classes implementing network support • Examples: • talking to HTTP servers • talking to FTP servers • DNS lookup • manipulating IP addresses • managing cookies • authentication • … ftp http dns
XML Namespace • The XML namespace provides the classes implementing creating, manipulation, etc of XML. • Examples classes: • Xml (processing xml) • Schema • Serialization • XPath • XSL • … <?xml version="1.0" standalone="no"?> <Mail> <From>Author</From> <To>Receiver</To> <Date> Thu, 7 Oct 1999 11:15:16 -0600</Date> <Subject>XML Introduction</Subject> <body><p>Thanks for reading<Br/> this article</p> <br/> <p>Hope you enjoyed this article</p> </body> </Mail>
Web Namespaces • The Web namespace provides the classes related to Web programming. • Examples classes: • Web • HttpResponse • Mail • UI (Server side controls) • Services • …
Web Services Distribution • Web Services let client code access software components across networks using standard protocols such as SMTP and HTTP. • Infrastructure needed to make Web Services work: • Data formats and protocols to enable Web Services to communicate • A standard way for Web Services to describe themselves • A way for clients to discover Web Services
Data Formats and Protocols • One of the advantages of Web Services over COM and CORBA is the use of standard data formats and protocols over proprietary offerings. • Clients can communicate with Web Services in three ways: • Using HTTP GET commands • Using HTTP POST commands • Using SOAP (Simple Object Access Protocol)
Web Service Description • The .NET Framework provides a Web Service Description Language (WSDL). It describes: • Methods exposed • Input parameters • Output parameters It provides this information using XML
Web Service Discovery • DISCO (Discovery of Web Services) • SOAP based protocol • Defines format for description of data • Protocol for retrieving this data • Advertisement of Web Services Posting DISCO files on your Server • Clients use DISCO files to navigate to • WSDL documents
COM – Enterprise Java Beans - .NET • Deploy the class as a Dynamic Link Library or Executable • Deploy bean as a JAR file • Deploy assembly as a Dynamic Link Library or Executable • Notion of interfaces and implementations • Notion of interfaces (Remote Interface & Home Interface) and implementation (bean) • Notion of exposed methods (Described in Web Service Description Language) • Use abstract base class to define binary interfaces • Enterprise Java Bean Server / Container specification • Use intermediate language, common type system, common language specification
COM – Enterprise Java Beans - .NET • Techniques for dynamically selecting implementations • Use Java Naming and Directory Interface for locating Beans (actually home object) • DISCO (Discovery of Web Services) protocol • Dynamic discovery of implemented interfaces • ??? Not applicable because you never talk to bean directly. • ??? Use Web Service Description Language
References Microsoft Visual C++ .NET Step by Step (2002) Julian Templeman and Andy Olsen ISBN: 0-7356-1567-5 Web Services Essentials (2002) Ethan Cerami ISBN: 0-596-00224-6