Part C - Introduction to Programming and the .NET Framework

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
Introduction to the C# Programming Language for the VB Programmer.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 18 Microsoft’s Approach 1 –.NET Mobile Framework Rob Pooley.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
Overview of Microsoft.Net and Vb.Net ITSE 2349 Spring 2002 Material from Microsoft.Net an Overview for ACC faculty by Stuart Laughton and Introduction.
CSCI 3327 Visual Basic Chapter 1: Introduction to Visual Basic
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Introduction to .Net Framework
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
 2002 Prentice Hall. All rights reserved. 1 Introduction to Visual Basic.NET,.NET Framework and Visual Studio.NET Outline 1.7Introduction to Visual Basic.NET.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
Microsoft Visual Basic 2005: Reloaded Second Edition
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Understanding Code Compilation and Deployment Lesson 4.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
.NET Framework Danish Sami UG Lead.NetFoundry
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
DotNet Michelle Johnston, Firebird Services Ltd. What is Dot Net Aims to simplify web development Language independent – CLR (Common Language Runtime)
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
Lecture 1: The .NET Architecture
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Introducing the Microsoft® .NET Framework
What is .NET.
Introduction to .NET framework
.NET Omid Darroudi.
INF230 Basics in C# Programming
Introduction to Computer CC111
Chapter 1 Introduction to Computers, Programs, and Java
Introduction to Visual Basic 2008 Programming
Chapter 2: System Structures
.Net A brief introduction to
Introduction to .NET Framework Ch2 – Deitel’s Book
CE-105 Spring 2007 Engr. Faisal ur Rehman
Application Foundation
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
Social Media And Global Computing Introduction to Visual Studio
Advanced Programming: C# Lecture 01: Introduction
Chapter 2: System Structures
CIS16 Application Development – Programming with Visual Basic
Introduction to .NET By : Mr. V. D. Panchal Content :
ASP.NET
Introducing the .NET Framework
Chapter 7 –Implementation Issues
DOT NET ARCHITECTURE (OR) DOT NET FRAME WORK ARCHITECTURE
IS 135 Business Programming
Presentation transcript:

Part C - Introduction to Programming and the .NET Framework Lecture Set 1 Part C - Introduction to Programming and the .NET Framework 9/22/2018

Objectives -- What we will learn about as the course progresses… Visual Studio – how to use it – more details This all about terminology you have to use it to learn it it is like a new language – if you do not use it in conversing with me and your classmates we will have problems everywhere – especially on tests etc Some of the terms … The .NET Framework – navigating around and making the most of this tool and its parts The Common Language Runtime (CLR) and how to build applications an component libraries in the CLR The Framework Class Library (FCL) The Common Type System (CTS) more …

More on What We Will Learn … OOP programming features Event driven programming – it’s different Structured exception handling Memory management Working with sequential files and databases The breakdown – Lectures – what and why of .NET Labs – how to do it

Dot NET and COM COM = Component Object Model Microsoft technology Makes it possible to distribute and reuse code using DLLs What is a dll? Supports language interoperability

Dot NET and Java Platform Supports many modern features Method overloading Parameterized constructors Inheritance Garbage collection Compilation into an intermediate language that is platform independent Dot NET is Microsoft’s “competitive” response to Java (the language and the platform)

The Dot NET Platform 1 (optional) Improvements on COM Better OOP support Easier to master Easier to deploy Easier to distribute and modify DLLs Totally platform independent – not coupled to particular hardware or OS architecture (can run on high end servers as well as handheld devices and client machines (our own PCs) The basic view 

Dot NET in a Picture (again - optional)

Dot NET Platform 2 - CLR Dot Net Framework – several versions The standard framework we use The CF or compact framework used on lightweight devices – pocket PCs, cell phones, etc Common Language Runtime System Standard runtime environment Execution engine – loads and executes code Managed code – all software written to target to .NET Framework is known by this name

Dot Net Architecture -- with multiple platform use (optional)

Dot Net Platform 3 - CLI Common Language Infrastructure Drafted blueprint for creating implementations of .NET on systems such as UNIX and OS X (more on this later) In other words – the CLI is like a Standard If the standard is adhered to by all .NET languages, you can … write systems using these different languages run these systems on different computers using different operating systems

Compiling a .NET Program Visual Studio compiles a program into machine independent assembly language called intermediate language (IL) or Microsoft Intermediate Language (MSIL) IL gets translated into executable code using the just-in-time compiler (JIT) The process is automatic It is done on a method-by-method basis the first time a method is called

Compiling and Executing a Visual Studio Project Clicking Build ProjectName builds of compiles a project ProjectName is a placeholder for the actual project name Visual Studio calls the C# Compiler Project configuration options are used to set the compiler options Compiler output appears in the Output window 

The Output Window

Executing a Visual Studio Project Pressing F5 builds and runs a project Clicking Debug, Start Debugging builds and runs a project in Debug Mode Console Application output appears in a Command Prompt window

Compiling and Running Code (again)

Managed Code and Assemblies 1 Key aspect of .NET Framework Managed code is what makes multiple language use really work in .NET We have managed versions of all .NET Languages such as C#, J#, C++, VB, COBOL Each such language must have its own .NET compiler Translates language code into a multipart Assembly Assembly – package of managed code components used for distribution and deployment Building blocks for .NET applications Managed code must meet a set of predetermined specifications defined by the Common Language Infrastructure (we will learn more about this later)

Managed Code and Assemblies 2 Assembly – logical program unit (one or more files) with .exe or .dll extensions Contents of an Assembly is NOT like the old .exe or .dll files you may know Must adhere to standard format expected by the CLR or it cannot run Metadata – describe assembly and types used Executable code – intermediate language representation of your code Information about the classes used in your code An encapsulation boundary

Managed Code and Assemblies 3 (Pattison - optional)

Assemblies – The Manifest (optional) Contains high level description of assembly Friendly name (no extension) Version number Culture setting – pertains to language used Public and digital keys – identification and authentication of developer and/or company etc List of dependent assemblies – (List of external references) all classes (and corresponding assemblies) on which this one depends

Assemblies – Executable Code Your code is NOT yet compiled into executable code Rather it is COMPILED into the intermediate language representation Your IL code is platform and language independent (front end and back end independent) Your compiled code must always still be translated into executable code before it is run on your computer. This is done at run-time by the J I T

Managed Languages Do we care what you use? Choices include C#, J#, COBOL, VB .NET, C++ Choose based upon your past experience C or C++ or Java experience  C# VB experience  VB Java experience  C# or J# Language interoperability far improved over COM But you must use managed features of languages to get the kind of desired attention How does this work??

Common Language Runtime – CLR 1 Execution engine for running managed code What’s it do? (What many other run-time systems do!!) Loads .NET assemblies Manages memory for classes and objects Provides run-time services File management Garbage collection Error detection

Common Language Runtime – 2 (optional) Before your code can execute … A special DLL is loaded by windows It initializes a session of the CLR (this CLR process has to start up before any .exe application you launch can execute) This DLL simply performs a bootstrap process that loads another DLL (The names of the DLLs are not important here)

Bootstrapping the CLR (optional) Launching a .exe … MSCORWKS – optimized for workstations with a single processor Loaded version Of CLR passes Control to entry Point in your .exe file MSCOREE launches implementation of CLR optimized for host architecture Windows loads MSCOREE MSCORSVR – optimized for servers (workstations with multiple processors) . Bootstrap component Of CLR Alternate implementations Of CLR optimized for your environment

Starting Up an Application Ah, but it is not quite that simple … Why not? The executable aspects of your.exe and .dll assemblies are still in the intermediate language form Need quick translation to native machine code that can be directly executed on the targeted (host) machine Just-In-Time (JIT) translation

The Just in Time Approach 1 Granular Continues over life time of application One method at a time SO … when a method in class in an assembly is needed for the first time … CLR inspects metadata for a referenced assembly (.dll or .exe) to ensure it meets requirements for managed code CLR locates entry point method in assembly CLR loads assembly (contains IL representation of executable code) As a method is called, it is translated into machine code for the targeted architecture (“Just-in-time” compilation)

The Just in Time Approach 2 Applications begin execution at the entry point method in a .exe file If a method in a .dll is called: The application .exe gets the information it needs about the .dll from the reference information in the .exe manifest CLR locates assembly file (the .dll) to be loaded (this is called assembly resolution) Only the called method in the .dll is translated at the start

Managed Execution Advantages No need for direct memory management Manages memory behind the scenes Safe mode – no pointers Protects against poorly written code No tricks with pointers – no buffer overflow attack CLR catches unsafe code in verification checks Security features – Code Access Security CAS More granular than what Windows allows – by Assembly Fewer common hard to find bugs Higher human productivity C#.NET does not allow unsafe code

Framework Class Library – FCL (optional) Visual Studio has a huge set of pre-written classes – grouped together into Namespaces (similar in to Java Packages) Maintaining collections, GUIs, DBMS, strings, dates, text files Several implementations Windows specific framework Compact framework You have to be careful in cross platform apps Common Language Infrastructure (CLI) defines a core set of classes for every implementation of the FCL (Base Class Library) Defines the blueprints for developing versions of .NET for different operating systems Other FCLs may have a different set of classes over and above the Base Class Library

System-supplied Class Libraries 1 Every managed application depends on one or more assemblies from the FCL These Assemblies are known as dlls System.Core dll and System dll – contain definitions of data stores and methods that make up the core system supplied data types Others – System.Data dll System.Drawing dll Data conversion, DBMS, sequential files -- (see next page)

System-supplied Class Libraries 2 - Commonly Used Assemblies of the FCL Assembly Name Purpose System.Core Core system types (every Assembly needs these classes) System CLR-specific system types (holds classes specific to Windows version of .NET – vs. Compact version) System.Data ADO.NET – DBMS support System.Drawing Windows graphics functionality - drawing System.Management Windows computer management System.Messaging MSMQ messaging services System.Security Programmatic security System.Web ASP.NET System.Web.Services Additional Web service support for ASP.NET System.Windows.Forms Windows Forms framework System.XML Support for programming in Extensible Markup Language(XML) Microsoft.VisualBasic Visual Basic methods, constants, and attributes NOTE – File names are the same as the Assembly names but with .dll at the end

System-supplied Class Libraries 3 - Commonly Used Assemblies of the FCL A few examples … System.Core – contains core system supplied types (required for all code you write) The C# library contains numerous string processing methods The C# library contains numerous data conversion methods that you will learn about in Chapters 4-9 and beyond The C# library contains numerous namespaces that in turn contain classes which in turn contain methods for handling abstractions such as Database processing Sequential file processing Drawing (simple graphics)

System-supplied Class Libraries 4 - Commonly Used Assemblies of the FCL More examples … The System.Drawing library contains methods for handling colors, brushes, shapes, lines, etc. The System.Data library contains methods that support ADO.NET (ActiveX Data Objects) for database access and processing

Applications Several kinds of applications: desktop and server-side Desktop (CIS 3309) Console (desktop) – batch oriented tasks; display messages through console window Can run thru Windows Explorer or DOS commands Uses a console system class Windows Forms Rich user interface – loads of controls Looks like an e-commerce page Games? Server-side (CIS 3309, 4344) ASP.NET – for creation of server-side apps to communicate with client apps across network using HTTP (Hypertext Transfer Protocol)

Why use .NET? 1 (optional) Move away from Windows 32 bit API and COM-based APIs – a Microsoft decision Integrated Development Environment (IDE) – Much improved for designing, writing and debugging software Platform neutrality / language neutrality Managed language support Framework Class Library Mechanisms for code distribution and deployment Improved security

Why use .NET? 2 (optional) Better execution performance Far better software engineering capabilities across all aspects of the development process Easier to create distributed applications across vendor and platform boundaries Easier to build distributed applications in larger networked environments such as the Internet Take advantage of various class libraries facilitating targeting to lightweight and special devices such as pocket PCs, cell phones, tablet PCs, etc Interoperability with older code – staged conversion

Costs of using Dot Net (optional) Lots to learn … become comfortable with: New suite of development tools – IDE Visual Basic .NET Inner workings of the CLR Become familiar with the classes in the FCL Distribution, deployment, and revision How to go about transitioning from old code to .NET code Comes with a lot of execution time “overhead” or “baggage” We focus more on top 4 items; less on last 3