Netprogramming_report1_thuannpgc00853.docx

  • Uploaded by: Vo Quang
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Netprogramming_report1_thuannpgc00853.docx as PDF for free.

More details

  • Words: 2,769
  • Pages: 14
FPT University University of Greenwich

Programming in .NET

Programming in .NET Assignment 1 Lecturer: Do Quoc Binh

Nguyen Phuong Thuan GC00853

Contents INTRODUCTION .......................................................................................................................... 3 TASK1 ............................................................................................................................................ 4 1.1

Interoperability (1) ......................................................................................................... 4

1.2

Backward compatibility (2) ........................................................................................... 4

1.3

Common runtime engine (3).......................................................................................... 4

1.4

Language independence (4) ........................................................................................... 6

1.5

Base class library ............................................................................................................ 6

1.6

Deployment ..................................................................................................................... 7

1.7

Security ............................................................................................................................ 7

1.8

Portability ....................................................................................................................... 7

TASK2 ............................................................................................................................................ 9 2.1 Current version ................................................................................................................... 9 2.2 Backward compatibility ..................................................................................................... 9 2.3 Design consideration ........................................................................................................... 9 2.4 Alternative implementation ............................................................................................. 10 TASK3 .......................................................................................................................................... 11 3.1 Common Language Runtime (CLR) ............................................................................... 11 3.2 .NET Framework Class Library (FCL) .......................................................................... 11 3.3 Common Type System (CTS) .......................................................................................... 12 3.4 Common Language Specification (CLS) ........................................................................ 13 REFERENCES ............................................................................................................................. 13

INTRODUCTION This report considers the skills required to demonstrate knowledge and understanding in relation to Programming in .NET developments, in addition we will also be able to design effective solutions for given scenarios.

TASK1 1.1 Interoperability (1) Interoperability allows you to preserve and leverage existing investments in unmanaged code. The code runs under the control of the common language runtime (CLR) is called managed code, and code that runs outside the CLR is called unmanaged code. COM, COM +, C++ components, ActiveX components, and Microsoft Win32 API are examples of unmanaged code.

.NET Framework allows interacting with unmanaged code through platform invoke services, the namespace System. Runtime. Interop Services, C++ interoperability, and COM interoperability (COM interop).

1.2 Backward compatibility (2) Backward compatibility means that an application has been developed for a specific version of a platform that will run on a later version of the platform. .NET Framework tries to maximize backward compatibility: the source code was written for one version of .NET Framework should compile on the following version of the .NET Framework, and the program runs on a version of .NET Framework should work exactly the same on the following version of the .NET Framework. *Backward compatibility and the .NET Framework 4.5: Backwards compatibility and .NET Framework 4.5 and later versions backwards compatible with applications built with previous versions of the .Net Framework. In other words, applications and components built with earlier versions will work without modification on .Net Framework 4.5 and newer versions. However, by default, applications running on versions of the common language runtime that we have developed, so you may have to provide the configuration file to allow applications running on .Net Framework 4.5 or a later version.

1.3 Common runtime engine (3)

The .NET Framework provides a runtime environment known as common language runtime, runs code, and provides services that make the development process easier. Compilers and utilities show common language runtime functionality and allow you to write code that is beneficial for this managed implementation environment. The code that you develop with a target language runtime engine is called managed code; It benefits from features such as crosslanguage integration, cross-language exception handling, security enhancements, versioning and deployment support, a simplified model for component interactions, error and fix the service.

         

The runtime provides the following benefits: Performance improvements. The ability to easily use components developed in other languages. Extensible types provided by a class library Language features such as inheritance, interfaces, and overloading for object-oriented programming. Support for explicit free threading that allows creation of multithreaded, scalable applications. Support for structured exception handling. Support for custom attributes. Garbage collection. Use of delegates instead of function pointers for increased type safety and security. For more information about delegates, see Common Type System.

1.4 Language independence (4) .NET Framework is a standalone language. This means that, as a developer, you can develop in one of many targeted languages. C ++, CLI, F #, Iron Ruby, Visual Basic, Visual COBOL, PowerBuilder, and Windows PowerShell. We can access the types and members of class libraries developed for the .NET Framework without having to know the language they were originally written without implementing any of the conventions of the language. original language If a component developer, that component can be accessed by any application. NET Framework regardless of its language.

1.5 Base class library

The base class library (BCL), part of the framework class library (FCL), is a library of functions is available to all languages using the .NET Framework. BCL provides classes to encapsulate a number of common functions, including file reading and writing, draw graphics, database interaction, and XML document manipulation etc.

Class library is a shared library concept for .NET. They allow the pairing of useful functions into modules that can be used by many applications. They can also be used as a means to load unnecessary or unknown functions upon application startup. Class libraries are described using the file format. NET Assembly.

1.6 Deployment The .NET Framework includes design features and the 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.

1.7 Security The design to solve some vulnerabilities like buffer overflows have been exploited by malicious software. Additionally, .NET provides some security model for all applications. .NET framework provides implementations of the standard cryptographic algorithms. These algorithms are very easy to use and have safe properties. Additionally, .NET Framework model of object inheritance, stream design and configuration is extremely extensible. Object Inheritance: .NET framework use extension model inheritance from inheritance class. The hierarchy is as follows: -

Algorithms type class, like Symmetric Algorithm, Asymmetric Algorithm or Hash Algorithm. This level is abstract Algorithms class inherits from an algorithm type class. This level is abstract Implementation of an algorithm class that inherits from an algorithm class. This level is fully implemented.

1.8 Portability The design of the. NET Framework allowing it to theoretically be platform Agnostic, and therefore cross-platform compatible. That is, a program written to use the framework should run without change on any kind of system that the framework was done.

We use mono to development for that. Mono is the open source platform based on the .NET Framework, allows the developers build cross-platform applications. Mono’s .NET implementation is based on the ECMA standards for C# and the Common Language Infrastructure. Some of the benefits to choosing Mono for application development: -

Popularity: Built on the success of .Net, there are millions of developers that have experience building applications in C#. Additionally, tens of thousands of books, websites, tutorials, and example source code to help with any imaginable problem.

-

Base Class Library - Having a comprehensive class library provides thousands of built in classes to increase productivity.

-

Higher-Level Programming - All Mono languages benefit from many features of the runtime, like automatic memory management, reflection, generics, and threading. These features allow you to concentrate on writing your application instead of writing system infrastructure code.

-

Cross Platform - Mono is built to be cross platform. Mono runs on Linux, Microsoft Windows, Mac OS X, BSD, and Sun Solaris, Nintendo Wii, Sony PlayStation 3, Apple iPhone and Android. It also runs on x86, x86-64, IA64, PowerPC, SPARC (32), ARM, Alpha, s390, s390x (32 and 64 bits) and more.

-

Common Language Runtime (CLR) - CLR allows you to select the most appropriate programming language and it can interact with code written in another CLR language. For example, you could write a class in C #, inherit from it in VB.Net, and use it in Eiffel. You can choose to write code in Mono in a variety of programming languages.

TASK2 2.1 Current version .NET Framework 4.7: The current version of .NET Framework is .NET Framework 4.7. Microsoft .NET Framework 4.7 is a highly compatible and up-to-date version of the Microsoft .NET Framework 4, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, and 4.6.2. It’s released on April 5, 1977 and have the features: - Strengthen password with encryption algorithms. Improved support for TLS (Transport Layer Security), especially in the version 1.2. - Strong support for DPI awareness in Windows Forms - Support for touch and touch pens in the Windows Presentation Foundation. - NET 4.7 is supported on Windows versions such as Windows 7, Server 2008, Server 2012, and so on.

2.2 Backward compatibility Backward compatibility is an application or software designed for a particular, specific version of a platform that will run on later and later versions of the platform. The .NET framework has the maximum compatibility of software as the source code of the .NET framework that should be compiled for later versions of it and the program that runs on a .NET version should work with and together across sessions. later version. The .NET Framework 4 is backward compatible with software or applications built by older .NET versions such as 1, 2 and 3. Applications, software and components are built on previous versions of .NET will be fully functional on .NET framework 4.

2.3 Design consideration LINQ is used to manipulate the data and is a crucial part of the .NET development.

To minimize the operation code to create software, increase productivity for Microsoft programmers have developed a method of integrated data for the .NET Framework and name it is a language-integrated query (LINQ), which is the Library open to the language programming such as C # and. NETWORK. It offers the ability to directly query objects, XML data and databases. The power of this library is that it can write the query to a lot of data objects and it can even query for a variable or array was created in code.

2.4 Alternative implementation We use mono to development for that. Mono is the open source platform based on the .NET Framework, allows the developers build cross-platform applications. Mono’s .NET implementation is based on the ECMA standards for C# and the Common Language Infrastructure. Some of the benefits to choosing Mono for application development: -

Popularity: Built on the success of .Net, there are millions of developers that have experience building applications in C#. Additionally, tens of thousands of books, websites, tutorials, and example source code to help with any imaginable problem.

-

Base Class Library - Having a comprehensive class library provides thousands of built in classes to increase productivity.

-

Higher-Level Programming - All Mono languages benefit from many features of the runtime, like automatic memory management, reflection, generics, and threading. These features allow you to concentrate on writing your application instead of writing system infrastructure code.

-

Cross Platform - Mono is built to be cross platform. Mono runs on Linux, Microsoft Windows, Mac OS X, BSD, and Sun Solaris, Nintendo Wii, Sony PlayStation 3, Apple iPhone and Android. It also runs on x86, x86-64, IA64, PowerPC, SPARC (32), ARM, Alpha, s390, s390x (32 and 64 bits) and more.

-

Common Language Runtime (CLR) - CLR allows you to select the most appropriate programming language and it can interact with code written in another CLR language. For example, you could write a class in C #, inherit from it in VB.Net, and use it in Eiffel. You can choose to write code in Mono in a variety of programming languages.

TASK3 3.1 Common Language Runtime (CLR) Some of the compilers like Visual Basic and C#, that target the Common Language Runtime and then compile to native code. CLR provides a debug engine (DE) to debug the resulting code. If you consider integrate your proprietary programming language into the Visual Studio IDE, you can choose compile for MSIL and therefore will not have to write DE of your own DE. However, you will have to write an expression evaluator (EE) that is capable of evaluating expressions within the context of your programming language. To allow the runtime provide services to managed code, the language compiler have to export metadata that describes the types, members, and references in the code. Metadata is stored with code; every common language can be able runtime. The runtime use metadata to locate and load classes, layout instances in memory, resolve method invoked, create a source code, implementing security.

3.2 .NET Framework Class Library (FCL) The .NET Framework provides a set of interfaces, as well as abstract and concrete (non-abstract) classes. We can use the special class, in many case, use the class of your own. To use the function of the interface, you can create a class implement interface, you can create a class implement .NET Framework. Naming Conventions: .NET Framework uses a naming scheme that dot syntax contains a hierarchy. This technique groups related types into namespaces so that they can be searched and referenced more easily. The first part of the full name-up to the dot on the right-is the namespace name. The last part of the name is the type name. For example, System. Collections represents the Array List Array List type., belongs to the namespace System. Collections. The types of System can be used with Collections ... to manipulate collections of objects. System Namespace: The System namespace is the root namespace for basic types in the .NET Framework. This namespace consists of classes representing the base data types used by all applications: Object (root of inheritance hierarchy), Byte, Char, Array, Int32, String, etc. This type corresponds to the

original data types that the programming language is used for. When we code using .NET Framework types, we can use the corresponding language tag when a .NET Framework base data type is expected.

3.3 Common Type System (CTS) Types in .NET: All types in .NET are either value types or reference types. Value types are data types where objects are represented by the actual value of the object. If an instance of a value type is assigned to a variable, that variable will be given a new copy of the value. Reference types are data types whose objects are represented by reference (similar to a pointer) to the actual value of the object. If a reference type is assigned to a variable, the reference to that variable will direct (point to) the initial value. No duplicates are created. The common type system in .NET supports the following five categories of types: - Classes: A class is a reference type that is derived directly from another class and is derived from System.Object. - Structures: A structure is a derived type derived from System.ValueType and derived from System.Object. A very useful structure to represent values that require memory is small. To pass values as value values to methods that have strong typographical parameters. In .NET, all primitive data types (Boolean, Byte, Char, DateTime, Decimal, Double, Int16, Int32, Int64, SByte, Single, UInt16, UInt32 and UInt64) are defined as structures. - Enumerations: An Enum (enum) is an inherited value type directly from System.Enum. Enum provides alternate names for the values of a primitive primitive type. A count type has a name, a base type must be one of the signed or unsigned integer types and a set of fields. These fields are static text fields, each field is constant. The same value can be assigned to multiple fields. When this happens, we must mark one of the values as the main counter value to reflect and convert the string. - Interfaces: Interface defines a contract that defines a "can do" relationship or a "one" relationship. Interfaces are often used to implement functions, such as comparison and classification (IComparable and IComparable interfaces), equality checks (IEquatable interface), or lists of Items in a collection (IEnumerable and IEnumerable interfaces). - Delegates: Delegates are reference types that serve a purpose similar to function pointers in C ++. They are used for event handlers and callback functions in .Net. Unlike function pointers,

delegates are secure, and type-safe. A delegate type can represent any instance method or static method with a signed signature.

3.4 Common Language Specification (CLS) CLS is designed to be large enough to include the language constructs that developers often need but are still small enough for most languages to support it. Additionally, any language structure makes it impossible to quickly verify the security of code excluded from the CLS so that all CLScompliant languages can produce a validation code if they choose like that. The following table summarizes the features in the CLS and indicates that this feature applies to both developers and compilers (all) or compilers only. It is intended to be informative, but not comprehensive. For details, see the specification for common language infrastructure. It is available on the Microsoft Developer Network (MSDN) Web site.

REFERENCES (1) (2) (3) (4) (5) (6) (7) (8)

Interoperability https://docs.microsoft.com/en-us/dotnet/csharp/programmingguide/interop/ Backward compatibility - https://docs.microsoft.com/en-us/dotnet/framework/migrationguide/version-compatibility. Common runtime engine - https://docs.microsoft.com/en-us/dotnet/standard/clr Language independence - https://docs.microsoft.com/en-us/dotnet/standard/languageindependence-and-language-independent-components. CTS: https://docs.microsoft.com/en-us/dotnet/standard/base-types/common-type-system FCL: https://msdn.microsoft.com/en-us/library/gg145045(v=vs.110).aspx CLR: https://docs.microsoft.com/en-us/dotnet/standard/clr https://msdn.microsoft.com/en-us/library/12a7a7h3(v=vs.100).aspx

More Documents from "Vo Quang"

Ly Luan Chinh Tri
April 2020 17
Kuisioner.docx
August 2019 34
Kuisioner.docx
August 2019 25
Kuisioner
August 2019 43