Professional Documents
Culture Documents
Chapter-1: Subject: Ite 4131 - Integrative Programming and Technologies 4 Year, Bsc. in Information Technology
Chapter-1: Subject: Ite 4131 - Integrative Programming and Technologies 4 Year, Bsc. in Information Technology
Chapter-1: Subject: Ite 4131 - Integrative Programming and Technologies 4 Year, Bsc. in Information Technology
CHAPTER- 1
INTRODUCTION
Faculty Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
Continues…..
5
.NET is the latest vision about how people will arrange and display
data from different sources distributed over the Internet. In a way
this makes sense because the emphasis is on a user-centric approach.
Simply put, .NET is Microsoft's strategy for delivering software as a
service.
Faculty Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
Main differences between .NET 1.1, 2.0, 3.0 and 3.5
6
Below figure '.NET growth' shows how the framework has evolved.
In .NET 1.1 we had the basic framework, web services, CLR, ADO
etc. .NET 2.0 They had modules like MARS, Generics, Partial
classes, DPAPI etc, Dot NET 3.0 had modules like WCF, WPF and
WWF, In .NET 3.5 has new query capabilities like LINQ, AJAX
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
Continues….
7
.NET 4.5.2-2013
.NET 4.6-2015 MVC, Web API, and Web Pages are unified into a single
framework called MVC 6.
.NET 4.6.1-2017
.NET 4.6.2
.NET 4.7
.NET 4.7.1
.NET 4.7.2-2019
.NET 4.8
.NET Framework 4.8 is the last version of .NET Framework. .NET
Framework is serviced monthly with security and reliability bug fixes. .NET
Framework will continue to be included with Windows, with no plans to
remove it. You don't need to migrate your .NET Framework apps, but for
new development, use .NET 5 or later.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
BASIC .NET FRAMEWORK:
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
CONTINUES….
10
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
Continues….
11
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
Microsoft .NET
14
Fig. 3
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
THE .NET EXPERIENCE
16
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
The .NET Platform
18
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Akram
Continues….
19
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Advantages of .NET
20
Various techniques
According used byframework,
to the .NET technical writers
all tosource
be effective:
code is first converted into
an intermediate code (called IL code) at compilation time. Before this IL
code can be executed, it must be converted to CPU-specific executable
code.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Understanding the .NET Framework:
23
TheVarious
.NET techniques used by technical
Framework writers to be effective:
is an environment for building, deploying,
and running Web Services and other applications. Microsoft .NET
framework is a standard that aims at integrating development of
Web applications and services using open Web standards such as
HTTP and XML. It consists of three main parts:
•The Common Language Runtime
•The Framework classes or Unified Programming Classes
•ASP.NET
Common Language
Various techniques Runtime
used by (CLR)
technical writers to be effective:
The .NET Framework provides a run-time environment called the
Common Language Runtime, which manages the execution of code
and provides services that make the development process easier.
The Common Language Runtime makes it easy to design
components and applications whose objects interact across
languages.
you can define a class, then, using a different language, derive a
class from your original class or call a method on it. You can also
pass an instance of a class to a method on a class written in a
different language.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
BASIC ARCHITECTURE OF .NET
25
FRAMEWORK
TheVarious
following Fig:used
techniques 5 depicts the basic
by technical writersarchitecture of .NET Framework.
to be effective:
Fig:5
In Fig. 5 let us consider the lowest layer i.e. the Common Language Runtime
(CLR). The Common Language Runtime is the execution engine for .NET
Framework applications.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Continues….
26
TheVarious
secondtechniques
layer isused
thatbyoftechnical
Unifiedwriters to be effective:
Programming Classes. You do not have to
design all your .NET types from the ground up. The .NET Framework includes
classes, interfaces, and value types that help expedite and optimize the
development process and give you access to system functionality.
The third layer is that of Data and XML (ADO.NET); this is used for data
management and maintenance. These services, commonly named as data services.
The fourth layer is that of ASP.NET, Web Forms and Windows Forms. These are
basically the user and program interfaces.
The upper-most layer includes all the languages supported by the .NET
Framework. A few of the languages are already mentioned in Figure: 5. At
present, the .NET Framework supports almost 84 languages.
All the five layers, as shown in Figure: 5, are fully supported in the Visual
Studio.NET IDE provided by Microsoft.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Common Language Specification:
27
AnVarious techniques
int uses 2 bytesused by technical
in C++ whilewriters to 4
it uses bebytes
effective:
in Java. This may lead to
serious problems in multiple language domains. CLS has been designed as
solution for this problem. Refer to Figure: 6
Fig:6
CLS is about language interoperability, its rules apply only to “externally visible” items.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Continues….
28
The root namespace for the types in the .NET Framework is the
System namespace.
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Continues….
29
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
C# LANGUAGES AND WEB SUPPORT
30
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Syntactical portion of C#
31
Table1
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Keywords and their purpose in C#
32
Table:2
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
ASP.NET
33
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
UNDERSTANDING COMMON LANGUAGE
RUNTIME
35
Fig:7
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Common Language Runtime
36
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
The Architecture of CLR
37
the CLR creates an environment for code execution called the Virtual Execution
System (VES). Figure 8 explains the precise working a .NET application with
parts of CLR shown as ovals.
Fig: 8
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Continues….
38
Faculty of Computing, JIT, Jimma University, Jimma, Oromia, Ethiopia Presented by Faiz Aram
Virtual, Override and new in C#:
38
39
40
But when you create a object of class B like following it will completely override the
functionality of class A. That is called method Overriding. Following is a code for that.
class Program
{
static void Main(string[] args)
{
B b=new B();
b.Print();
}
}
Now, if you run this code it will completely override the code and following will be output
as expected.
Continues….
41
42
class Program{
static void Main(string[] args)
{
B b=new B();
b.Print();
}}
Now if you run the code you will see output of both method as expected.
Continues….
43
44
public class A{
public virtual void Print()
{
System.Console.WriteLine("Virtual Print method from a");
}}
public class B:A
{
public override void Print()
{
System.Console.WriteLine("Override Print method from b");
}}}
In this code, same A class Print method is override by B class Print method and I have
created two object of class B. One with reference to base class A and another B itself.
Now let’s run this example and following is a output.
Continues….
45
Here you see both time it will override class A’s Print Method. Now let’s change
above code with new keyword like following.
namespace Oops
{
class Program
{
static void Main(string[] args)
{
A a=new B();
B b=new B();
Continues….
46
a.Print();
b.Print();
}}
public class A{
public virtual void Print()
{
System.Console.WriteLine("Virtual Print method from a");
}}
public class B:A{
public new void Print()
{
System.Console.WriteLine("Override Print method from b");
}}}
Continues....
47
If you see both outputs carefully then you will notice a difference. With
override keyword it will override Print method in both scenarios. While with
new keyword it will only hide print method and both method exist as separate
method so if you create a class A object with B then it will class A’s Print
method without hiding it and If you create class B object with B then it will
hide the base class method and print from class B’s method.
So that was the difference.
Programming C#
47
47
47
Before starting with the C# programming, you must install the C# compiler.
The C# command-line compiler, csc.exe, comes with Microsoft’s .NET SDK.
save the file as first.cs.
Listing 1. “Hello, C# world!” code
using System;
class Hello
{
Static void Main()
{
Console.WriteLine("Hello, C# world!");
}}
You can compile C# code from the command line using this syntax:
csc C:\\temp\first.cs
After compiling your code, the C# compiler creates an .exe file called first.exe
under the current directory. Now you can execute the .exe from window
explorer or from the command line. Figure 1 shows the output.
Continues....
47
47
You can access these classes from other application by referencing their
namespaces.
For example, you can create a new namespace MyOtherNamespace with a
method Hello defined in it. The Hello method writes “Hello, C# World!” to the
console. Example of the namespace in listing 2.
Continues….
52
Listing 2: Namespace wrapper for the hello class
// Called namespace
namespace MyOtherNamespace
{
Class MyOtherClass
{
public void Hello()
{
Console.WriteLine ("Hello, C# World!");
}}}
In listing 3, you’ll see how to reference this namespace and call MyOtherClass’s
Hello method from the main program.
Continues….
52
// Called namespace
namespace MyOtherNamespace{
Class MyOtherClass {
Public void Hello()
{
Console.WriteLine("Hello, C# World!");
}
}
}
As you have seen in listing 3, you include a namespace by adding the using
directly. You can also reference a namespace direct without the using directive.
Listing 4 shows you how to use MyOtherClass of MyOtherNamespace.
Continues….
52
Listing 4. Calling the HelloWorld namespace member from the MyOtherNamespace
// Caller namespace
namespace HelloWorldNamespace
{
class Hello
{
static void Main()
{
MyOtherNamespace.MyOtherClass cls =new
MyOtherNamespace.MyOtherClass();
cls.Hello();
}
}
}
Standard Input and Output Streams
52
A variable can have one or combination of more then one of the following types:
internal, new, private, public, protected, read only, and static.
Accessibility modifiers:
In listing 10, AccessCls is a class accessed by the Main method. The Main method has
access to num1 because it’s defined as a public variable, but not to num2 because it’s a
private variable.
Continues….
52
When you access class members, the num2 variable is not available in the list of its
members. See figure.
If you try access num2 from the main program, the compiler gives the error shown
in figure
52
THANK YOU