Presentation is loading. Please wait.

Presentation is loading. Please wait.

Session 1 - Introduction and Data Access Layer

Similar presentations

Presentation on theme: "Session 1 - Introduction and Data Access Layer"— Presentation transcript:

1 Session 1 - Introduction and Data Access Layer
.Net 2.0 basic concept

2 Overview of Microsoft .Net Framework
Session 1 - Introduction and Data Access Layer Overview of Microsoft .Net Framework is a software framework that can be installed on computers running Microsoft Windows operating systems. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for the framework -Explain the benefits of having .net framework on machine rather than using Traditional VB6

3 .NET framework on windows
Session 1 - Introduction and Data Access Layer .NET framework on windows Windows OS Windows API Windows Resource .NET Framework

4 .NET framework Technologies
Session 1 - Introduction and Data Access Layer .NET framework Technologies Principal design features Interoperability Common Runtime Engine Common Language Runtime (CLR) Language Independence Base Class Library  Common Functions: File Reading and Writing Graphics Rendering Database Interaction XML Document Manipulation Interoperability -ability to interact between new and older application like COM components Common Runtime Engine  - The Common Language Runtime (CLR) is the virtual machine component of the .NET framework. All .NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors in the areas of memory management, security, and exception handling. Language Independence - The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all possible datatypes and programming constructs supported by the CLR and how they may or may not interact with each other. Because of this feature, the .NET Framework supports the exchange of instances of types between programs written in any of the .NET languages. This is discussed in more detail in Microsoft .NET Languages. Portability - The design of the .NET Framework allows it to theoretically be platform agnostic, and thus cross-platform compatible. That is, a program written to use the framework should run without change on any type of system for which the framework is implemented. Microsoft's commercial implementations of the framework cover Windows, Windows CE, and the Xbox 360.[4] In addition, Microsoft submits the specifications for the Common Language Infrastructure (which includes the core class libraries, Common Type System, and the Common Intermediate Language),[5][6][7] the C# language,[8] and the C++/CLI language[9] to both ECMA and the ISO, making them available as open standards. This makes it possible for third parties to create compatible implementations of the framework and its languages on other platforms.

5 .NET Framework Advantages
Session 1 - Introduction and Data Access Layer .NET Framework Advantages Consistent Programming Model Direct Support for Security Simplified Development Efforts Consistent Programming Model Different programming languages have different approaches for doing a task. For example, accessing data with a VB 6.0 application and a VC++ application is totally different. When using different programming languages to do a task, a disparity exists among the approach developers use to perform the task. The difference in techniques comes from how different languages interact with the underlying system that applications rely on. With .NET, for example, accessing data with a VB .NET and a C# .NET looks very similar apart from slight syntactical differences. Both the programs need to import the System.Data namespace, both the programs establish a connection with the database and both the programs run a query and display the data on a data grid. The VB 6.0 and VC++ example mentioned in the first paragraph explains that there is more than one way to do a particular task within the same language. The .NET example explains that there's a unified means of accomplishing the same task by using the .NET Class Library, a key component of the .NET Framework. The functionality that the .NET Class Library provides is available to all .NET languages resulting in a consistent object model regardless of the programming language the developer uses. Direct Support Security Developing an application that resides on a local machine and uses local resources is easy. In this scenario, security isn't an issue as all the resources are available and accessed locally. Consider an application that accesses data on a remote machine or has to perform a privileged task on behalf of a nonprivileged user. In this scenario security is much more important as the application is accessing data from a remote machine. With .NET, the Framework enables the developer and the system administrator to specify method level security. It uses industry-standard protocols such as TCP/IP, XML, SOAP and HTTP to facilitate distributed application communications. This makes distributed computing more secure because .NET developers cooperate with network security devices instead of working around their security limitations. Simplified Development Efforts Let's take a look at this with Web applications. With classic ASP, when a developer needs to present data from a database in a Web page, he is required to write the application logic (code) and presentation logic (design) in the same file. He was required to mix the ASP code with the HTML code to get the desired result. ASP.NET and the .NET Framework simplify development by separating the application logic and presentation logic making it easier to maintain the code. You write the design code (presentation logic) and the actual code (application logic) separately eliminating the need to mix HTML code with ASP code. ASP.NET can also handle the details of maintaining the state of the controls, such as contents in a textbox, between calls to the same ASP.NET page. Another advantage of creating applications is debugging. Visual Studio .NET and other third party providers provide several debugging tools that simplify application development. The .NET Framework simplifies debugging with support for Runtime diagnostics. Runtime diagnostics helps you to track down bugs and also helps you to determine how well an application performs. The .NET Framework provides three types of Runtime diagnostics: Event Logging, Performance Counters and Tracing. Easy Application Deployment and Maintenance The .NET Framework makes it easy to deploy applications. In the most common form, to install an application, all you need to do is copy the application along with the components it requires into a directory on the target computer. The .NET Framework handles the details of locating and loading the components an application needs, even if several versions of the same application exist on the target computer. The .NET Framework ensures that all the components the application depends on are available on the computer before the application begins to execute.

6 Session 1 - Introduction and Data Access Layer
.NET framework Simplified Deployment  Tools for Deployment Conforms to Security Requirements Security  Portability  Simplified Deployment  - The .NET framework includes design features and tools that help manage the installation of computer software to ensure that it does not interfere with previously installed software, and that it conforms to security requirements. Security - The design is meant to address some of the vulnerabilities, such as buffer overflows, that have been exploited by malicious software. Additionally, .NET provides a common security model for all applications. Portability  - The design of the .NET Framework allows it to theoretically be platform agnostic, and thus cross-platform compatible. That is, a program written to use the framework should run without change on any type of system for which the framework is implemented. Microsoft's commercial implementations of the framework cover Windows, Windows CE, and the Xbox 360.[4] In addition, Microsoft submits the specifications for the Common Language Infrastructure (which includes the core class libraries, Common Type System, and the Common Intermediate Language),[5][6][7] the C# language,[8] and the C++/CLI language[9] to both ECMA and the ISO, making them available as open standards. This makes it possible for third parties to create compatible implementations of the framework and its languages on other platforms.

7 Common Language Infrastructure (CLI)
Session 1 - Introduction and Data Access Layer Common Language Infrastructure (CLI)

8 Session 1 - Introduction and Data Access Layer
Definition Common Language Infrastructure (CLI) The Core aspect of .NET framework Assemblies Stored in Portable Executable, DLL and EXE files. Composed of text name, version number, culture and public key token Sample Assemblies in web.config: <add assembly="System.Drawing, Version= , Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> Metadata It denotes the attribute of CIL or it describes itself. Security Common Language Infrastructure (CLI) - The core aspects of the .NET Framework lie within the Common Language Infrastructure, or CLI. The purpose of the CLI is to provide a language-neutral platform for application development and execution, including functions for exception handling, garbage collection, security, and interoperability. Microsoft's implementation of the CLI is called the Common Language Runtime or CLR. Assemblies - The CIL code is housed in .NET assemblies. As mandated by specification, assemblies are stored in the Portable Executable (PE) format, common on the Windows platform for all DLL and EXE files. The assembly consists of one or more files, one of which must contain the manifest, which has the metadata for the assembly. The complete name of an assembly (not to be confused with the filename on disk) contains its simple text name, version number, culture, and public key token. The public key token is a unique hash generated when the assembly is compiled, thus two assemblies with the same public key token are guaranteed to be identical from the point of view of the framework. A private key can also be specified known only to the creator of the assembly and can be used for strong naming and to guarantee that the assembly is from the same author when a new version of the assembly is compiled (required to add an assembly to the Global Assembly Cache). Metadata - All CIL is self-describing through .NET metadata. The CLR checks the metadata to ensure that the correct method is called. Metadata is usually generated by language compilers but developers can create their own metadata through custom attributes. Metadata contains information about the assembly, and is also used to implement the reflective programming capabilities of .NET Framework. Security - .NET has its own security mechanism with two general features: Code Access Security (CAS), and validation and verification. Code Access Security is based on evidence that is associated with a specific assembly. Typically the evidence is the source of the assembly (whether it is installed on the local machine or has been downloaded from the intranet or Internet). Code Access Security uses evidence to determine the permissions granted to the code. Other code can demand that calling code is granted a specified permission. The demand causes the CLR to perform a call stack walk: every assembly of each method in the call stack is checked for the required permission; if any assembly is not granted the permission a security exception is thrown. When an assembly is loaded the CLR performs various tests. Two such tests are validation and verification. During validation the CLR checks that the assembly contains valid metadata and CIL, and whether the internal tables are correct. Verification is not so exact. The verification mechanism checks to see if the code does anything that is 'unsafe'. The algorithm used is quite conservative; hence occasionally code that is 'safe' does not pass. Unsafe code will only be executed if the assembly has the 'skip verification' permission, which generally means code that is installed on the local machine.

9 Session 1 - Introduction and Data Access Layer
Definition Class library Organize in namespace Memory management It has Garbage Collector (GC) Class library - The .NET Framework includes a set of standard class libraries. The class library is organized in a hierarchy of namespaces. Most of the built in APIs are part of either System.* or Microsoft.* namespaces. These class libraries implement a large number of common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation, among others. The .NET class libraries are available to all .NET languages. The .NET Framework class library is divided into two parts: the Base Class Library and the Framework Class Library. The Base Class Library (BCL) includes a small subset of the entire class library and is the core set of classes that serve as the basic API of the Common Language Runtime.[10] The classes in mscorlib.dll and some of the classes in System.dll and System.core.dll are considered to be a part of the BCL. The BCL classes are available in both .NET Framework as well as its alternative implementations including .NET Compact Framework, Microsoft Silverlight and Mono. The Framework Class Library (FCL) is a superset of the BCL classes and refers to the entire class library that ships with .NET Framework. It includes an expanded set of libraries, including WinForms, ADO.NET, ASP.NET, Language Integrated Query, Windows Presentation Foundation, Windows Communication Foundation among others. The FCL is much larger in scope than standard libraries for languages like C++, and comparable in scope to the standard libraries of Java. Memory management - The .NET Framework CLR frees the developer from the burden of managing memory (allocating and freeing up when done); instead it does the memory management itself. To this end, the memory allocated to instantiations of .NET types (objects) is done contiguously[11] from the managed heap, a pool of memory managed by the CLR. As long as there exists a reference to an object, which might be either a direct reference to an object or via a graph of objects, the object is considered to be in use by the CLR. When there is no reference to an object, and it cannot be reached or used, it becomes garbage. However, it still holds on to the memory allocated to it. .NET Framework includes a garbage collector which runs periodically, on a separate thread from the application's thread, that enumerates all the unusable objects and reclaims the memory allocated to them.

10 .NET Framework Versions
This is the first release of the .NET Framework, released on 13 February 2002 and available for Windows 98, Me, NT 4.0, 2000, and XP. .NET Framework 1.1 This is the first major .NET Framework upgrade. was published on 3 April 2003. .NET Framework 2.0 Released with Visual Studio 2005, Microsoft SQL Server 2005, and BizTalk 2006. .NET Framework 3.0 formerly called WinFX,[20] was released on 21 November It includes a new set of managed code APIs that are an integral part of Windows Vista and Windows Server 2008 operating systems. It is also available for Windows XP SP2 and Windows Server 2003 as a download. There are no major architectural changes included with this release; .NET Framework 3.0 uses the Common Language Runtime of .NET Framework 2.0.[21] Unlike the previous major .NET releases there was no .NET Compact Framework release made as a counterpart of this version.

11 .NET Framework Versions
Version 3.5 of the .NET Framework was released on 19 November 2007, but it is not included with Windows Server As with .NET Framework 3.0, version 3.5 uses the CLR of version 2.0. In addition, it installs .NET Framework 2.0 SP1, (installs .NET Framework 2.0 SP2 with 3.5 SP1) and .NET Framework 3.0 SP1 (installs .NET Framework 3.0 SP2 with 3.5 SP1), which adds some methods and properties to the BCL classes in version 2.0 which are required for version 3.5 features such as Language Integrated Query (LINQ). These changes do not affect applications written for version 2.0

12 Using C# 2.0

13 Overview of the C# Language
Session 1 - Introduction and Data Access Layer Overview of the C# Language C# is an object-oriented programming language developed by Microsoft Corporation as part of their .NET initiative in response to the success of Sun Microsystems' Java programming language. Majority of the syntax are almost the same with Java, C and C++. C# Design Goals: C# is intended to be a simple, modern, general-purpose, object-oriented programming language. The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic garbage collection. Software robustness, durability, and programmer productivity are important. The language is intended for use in developing software components suitable for deployment in distributed environments. Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++. Support for internationalization is very important. C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions. Although C# applications are intended to be economical with regard to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language A Brief History of C# C# was designed for developing components in a fully object-oriented manner as part of the Microsoft .NET initiative. C# debuted in the year 2000 at the Professional Developers Conference (PDC) where Microsoft founder Bill Gates was the keynote speaker. At the same time, Visual Studio .NET was announced. The primary architects of C# were Peter Golde, Eric Gunnerson, Anders Hejlsberg, Peter Sollichy, and Scott Wiltamuth. Of these, the principal designer of the the C# language was Anders Hejlsberg, a lead architect at Microsoft. Previously, he was a framework designer with experience with Visual J++ (Microsoft's old version of the Java language), Delphi, and Turbo Pascal. Both C# and the Common Language Infrastructure (CLI) have been submitted to international standards organizations European Computer Manufacturers Association (ECMA) and International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC). The Java Connection - You will find that many C# books and sources ignore or minimize the role of the Java language in the development of C# and .NET, as if it were all Microsoft's original idea. This view is prevalent in exclusively Microsoft shops. However, the fact is that Microsoft was a latecomer to Internet development and the oft cited pedigree of C# from C and C++ applies equally well to the Java language, which preceded C# by some five years. Microsoft and Sun Microsystems have a long history of legal struggle over control of the Java language, a battle which Sun finally won. Prevented from adapting the Java language to the Windows platform, Microsoft decided to go its own way using its own version of the Java system—namely C# and .NET. The influence of the Java language on C# and other languages takes nothing away from C#, which in some ways improves upon its ancestor.

14 C# Language Reference and Syntax
Variable Declaration: Format: <DataType> <Variable Name>; Sample: int x; int y = 0; MyClass myClass = new MyClass();

15 C# Language Reference and Syntax
Function/Subroutine declaration: public string GetName() { } public Void ProcessFile()

16 C# Language Reference and Syntax
Session 1 - Introduction and Data Access Layer C# Language Reference and Syntax Conditionals: Simple: if (condition) { // condition is true } Complex: else { // condition is false

17 Session 1 - Introduction and Data Access Layer
Welcome to Discuss Brief Background Visual Studio -Visual Studio 6.0 -Visual Studio 2003 for .NET 1.1 -And now Visual Studio 2005 for .NET 2.0 -Explain Each Application Type -Differentiate Solution and Project: -Discuss Solution Explorer and Property Windows -Add new Class -Explain Namespaces

Download ppt "Session 1 - Introduction and Data Access Layer"

Similar presentations

Ads by Google