0% found this document useful (0 votes)
34 views

VP - Lecture 1 - Overview

visual programming

Uploaded by

Aneeza Yasmeen
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

VP - Lecture 1 - Overview

visual programming

Uploaded by

Aneeza Yasmeen
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Visual Programming

Introduction to Visual Programming and


C# & IDE Setup
Rida Bajwa
Recap …

• Previous Discussion:
⮚ Course Outlines
Today’s Discussion
⮚ Microsoft .Net framework

⮚ What's in the .NET Framework?

⮚ Writing applications using .net framework

⮚ .NET framework Architecture

⮚ Benefits of .NET framework


.Net Framework
Microsoft .Net framework
• .NET is an open-source developer platform.
• Created by Microsoft
• Provides a platform for developing multi platform applications
applications.

• Allows developing apps/software for


⮚ desktop,
⮚ web,
⮚ games,
⮚ and IoT (Internet of Things).
Microsoft .Net framework (cont.)
• An essential component of window OS
• helps in creating application by integrating different languages
• C#,
• Visual Basic (VB),
• J#
• and Visual C++

• Consists of virtual Environment system called Common Language


Runtime (CLR) and set of libraries.
What's in the .NET Framework?
• .NET Framework consists of code
• Client-or server-side code (such as C#) using OOP techniques

• Different modules
⮚ For different operating systems
⮚ to support some or all of the features, depending on their
characteristics

• basic types
.NET Standard and .NET Core
.NET Standard and .NET Core
• .NET Core: the most optimal solution for cross-platform code
development.
⮚ Contains APIs for basic actions
for example, file access, string manipulation, managing streams,
⮚ storing data
⮚ in collections, security attributes, and many others.

• .NET Standard: a class library that exposes


⮚ A standard set of basic programming APIs
⮚ supports any fork or flavor of application using the .NET Platform.
Writing Apps Using the .NET
Some important concepts
Writing apps using .NET
• Means writing code (using any of the languages that support the
Framework) using the NET code library.

• Usually use Visual Studio for your development.


• A powerful, IDE that supports
• C#
• Managed and unmanaged C++,
• Visual Basic,
• and some others
Writing apps using .NET (cont.)
• In order for C# code to execute,
⮚ it must be converted into a language that the target OS
understands, known as native code
⮚ This conversion is called compiling code, an act that is
performed by a compiler
⮚ Under the .NET Framework and .NET Core, this is a two-stage
process.
CIL and JIT
• In the past, was often necessary to compile apps for targeting a specific
OS and CPU architectures
• Usually for optimization purposes

• Now unnecessary because of JIT compilers


• Compiles only when necessary (As the name suggests)
• use machine independent CIL code, which is independent of the
machine, operating system, and CPU.

• Different JIT compilers for targeting a different architecture, and to


create the native code when required
• Can forget about system-dependent details and concentrate on the
more interesting functionality of your code.
CIL and JIT (cont.)
• When code is compiled, it isn’t immediately converted int OS–specific native
code.
• Compiled into Common Intermediate Language (CIL) Code (previously known
as Microsoft Intermediate Language (MSIL)).
• isn't specific to any OS)

• Carried out by Visual Studio when developing applications.

• Just-in‐time (JIT) compiler, compiles CIL into native code specific to the
targeted OS and machine architecture.
• Only at this point can the OS execute the application.
• compiled only when it is needed.
• Can happen on the fly while application is running,

• compilation process works in the background, without interfering.


Assemblies
∙ When you compile an application, the CIL code is stored in an
assembly. Includes:
⮚ executable application files (that can run directly), having
an .exe file extension
⮚ and libraries (haviing a .dll extension) for use by other
applications.

∙ Also include meta information and optional resources (additional


data such as sound files and pictures).
⮚ The meta information enables assemblies to be fully self-
descriptive.
Assemblies (cont.)
∙ Deploying applications is often as simple as copying the files into
a directory on a remote computer.
⮚ just run an executable file from this directory (assuming
the .NET Framework is installed)
⮚ no additional configurations are required (all required
modules are included in the package)
Execution
Process
Linking
• CIL needn't be contained in a single file
• Possible to split code across multiple source-code files,
• compiled together into a single assembly.

• Can separate logically related code into an individual file


⮚ Divides the programming burden into manageable chunks
⮚ Far easier to work with several smaller files
⮚ Provides Abstraction and reusability
.Net Framework Architecture
.NET framework Architecture

Common Language .NET framework


Runtime (CLR) Class Library

Common Language Common Type


Specifications (CLS) System (CTS)
1. Common Language
Runtime (CLR)
• runtime environment called Common
Language Runtime (CLR).
• It provides an environment to run all
the .NET Programs.
• The code which runs under the CLR is
called as Managed Code.
• Programmers need not to worry on
managing the memory
• Programmatically, when our program
needs memory, CLR allocates the memory
for scope and de-allocates the memory if
the scope is completed.
CLR
• Language Compilers
(e.g. C#, VB.Net, J#) will
convert the
Code/Program
to Microsoft
Intermediate
Language (MSIL)

• this will be converted


to Native Code by CLR.
2. .NET Framework Class Library
(BCL)

• Also called as Base Class Library

• Common for all types of applications i.e.


• The way of accessing the Library
Classes and Methods in VB.NET will be
the same in C#,
• it is common for all other languages
in .NET.
2. .NET Framework Class Library
(BCL)
• just import the BCL

• Use its predefined methods and properties to implement


common and complex functions like
⮚ Reading and writing to file
⮚ Graphic rendering
⮚ Database interaction
⮚ XML document manipulation.
3. Common Type System(CTS)
• Describes set of data types that can be used in different .NET
languages in common
• Ensures objects written in different .NET languages can interact
with each other.

For Communicating between programs written in any .NET


language, the types have to be compatible on the basic level.
3. Common Type System(CTS)
3. Common Type System
Supports two general categories of types:
1. Value types:
• Directly contain their data
• Instances are allocated on the stack
• Can be
• built-in (implemented by the runtime), user-defined, or enumerations.

2. Reference types:
• ​Stores a reference to the value's memory address,
• Are allocated on the heap
• Can be :
• self-describing types
• pointer types (arrays and class types)
• interface types
4. Common Language Specification(CLS)

• Sub set of CTS


• Specifies a set of rules that needs to be adhered or satisfied by all
language compilers targeting CLR.
• Helps in cross language inheritance and cross language debugging

Sample Rules:
• Representation of text strings
• Internal representation of enumerations
• Definition of static members

Microsoft defines CLS as nothing but guidelines that language


needs to follow so that it can communicate with other .NET
languages in a seamless manner.
Benefits of .NET framework
Benefits of .NET framework
1. Consistent Programming Model
2. Cross Platform Support
3. Language Interoperability
4. Automatic management of Resources
5. Ease of Deployment
6. Garbage Collection
Consistent Programming Model
• .NET provides a consistent Object Oriented Model across
different Programming languages

• This model used to create programs for performing different tasks


⮚ Connecting to and retrieving data from database
⮚ Read and write data from files.
Garbage Collection
• One of the most important features.
• makes sure that the memory used by an application is freed up
completely when no longer in use.

• Prior to .NET this was mostly the responsibility of programmers,


• Works by periodically inspecting the memory and removing
anything that is no longer needed

• No set time frame for this;


• it might happen thousands of times a second, once every few seconds, or
whenever, but can rest assured that it will happen.
Wrap up
Summary
⮚ Microsoft .Net framework

⮚ What's in the .NET Framework?

⮚ Writing applications using .net framework

⮚ .NET framework Architecture

⮚ Benefits of .NET framework

You might also like