General information about the main concepts of the .NET Framework platform. Look around. Basic understanding Understanding the middle. Factors of the middle and their classification

Golovna / Main functionality

A collection of koshtіv, for the help of such programs, they are written, edited, converted to machine codes, improved, they are launched, named the middle of the expansion or shell. Platform.Net or .net framework– ce more lower just the middle of the rosette programs, the price of a new revolutionary release of earlier technologies by Microsoft, which allows the development of different types of programs with different languages, programming for different operating systems.

NET Framework is a suprabudovoy over the operating system, which can be a version of Windows, Unix and a different OS (for retailers), and is composed of low components. So, . NET Framework includes:

  1. Chotiri official movie: С#, VB.NET, Managed C++ and JScript .NET.
  2. Zahalnomovne object-oriented middleware CLR (Common Language Runtime), like a splendid virtuoso movie for creating programs.
  3. A number of related libraries of classes under the global names FCL (Framework Class Library).

The main component of the platform. NET Framework is the fundamental core of the CLR software. The name of the middle - "the cryptic middle of the vikonnanny" - seems to be for itself: the same is the middle of the middle, as it is suitable for different types of programming. Prior to CLR functions are:

  1. two-way compilation: program conversion, written by one mov programming into coded code my intermediary ( Microsoft Intermediate Language, MSIL or just IL), and then converting the IL code into the machine code of a specific processor, which is used for the help of a virtual machine or a JIT compiler (Just In Time compiler - compiling exactly up to the required moment);
  2. code management: capturing and modifying a ready-made IL code for the help of a JIT compiler;
  3. zdіysnennya access to metadata with the method of reverification security code;
  4. management of memory when placing objects for the help of a picker (Garbage Collector);
  5. processing of vignettes and vinyatkovy situations, including interstitial vignettes;
  6. zdіysnennya vzaєmodії mizh kerirovannym code (code, creations for CLR) and non-kernable code;
  7. pіdtrimka servіsіv for rozrobki raznotypnyh prog.

Let's start with the component. Net Framework є FCL – platform class library. This library is divided into a sprinkling of modules in such a way that it is possible to win that part, depending on the necessary results. So, for example, in one of the modules there are "ceglins", from which you can induce Windows add-ons, in the other - "ceglins", which are necessary for working in a measure, etc.

Part of the FCL is devoted to the description of basic types. Type - the way of presenting data; designation of the most fundamental and easier ways of programming with help. NET framework. All at once the price is called the Common Type System (CTS - a single type system).

In addition, the FCL library includes the Common Language Specification (CLS - global language specification), which establishes: the basic rules of modern integration. The CLS specification dictates the minimum amount of effort required to move the platform. NET. Compilators who satisfy this specification create objects, building mutually one by one. Therefore, be it a language, as a support for the support of CLS, you can win all the possibilities of the FCL library.

Yak was designated as the main mov, recognized for the platform. NET Framework, є #, VB. NET, Managed C++ and JScript. NET. For these languages, Microsoft recommends compilers that translate the program into IL code, which is the case for the JIT compiler of the CLR environment. Microsoft, a handful of companies and academic organizations have created powerful compilers that generate code that works in the CLR. Currently there are compilers for Pascal, Cobol, Lisp, Perl, Prolog, etc. Tse means that you can write a program, for example, in the Pascal language, and then, using a better compiler, create code that will work on the CLR.

Understanding the program, project, solution

NET Framework does not impose any annual restrictions on the types of programs that can be created. Tim is not smaller, let's take a look at the types of supplements that are most often used:

  1. Console programs allow you to enter the "console", that is, in front of the command processor.
  2. Windows-programs that bind elements of the Windows interface, including forms, buttons, proportions, etc.
  3. Web add-ons are web-sides, which can be looked at with any web browser.
  4. Web services are separate addendums that allow you to exchange over the Internet, practically being a tribute to a common syntax regardless of the fact that the language was programmed when the web service was created and it was not placed on any system.

The addendum that the development process has is called a project. Dekіlka programs can be combined into a solution.

The manual development environment for the Visual Studio .Net software.

Visual Studio development environment.

In this course, we will use language C#. Acquaintance with my rozpochnem z rozrobki console programs. As a medium of development, we will vicorate Visual Studio. Net (VS).

You can create files with custom code in C# with the help of a great text editor, for example, Notepad, and compile them core modules for the help of the compiler of the command row, which is a warehouse part. NET framework. However, it is most convenient for these goals to win VS, to that:

  1. VS automatically picks up all the necessary compilations of output code.
  2. A text editor for VS customizations for robots with movs, which are supported by VS, for example C#, so you can intellectually show pardons and suggest in the process of introducing, which code itself is required.
  3. The VS warehouse includes programs that allow you to create Windows-and Web-additions by simply dragging the mouse elements into the interface of the host.
  4. A lot of types of projects, which can be created in C#, can be developed on the basis of the "framework" code, which is included before the program. Instead of starting from scratch, VS allows you to edit files with original code, which is already obvious, which will change the time spent on creating a project.

Creation of the first project

To create a project, run VS, and then at the main menu of VS, select the command File - New - Project. After what the dialog menu is shown new project(Div. fig. 1.1).


Rice. 1.1.

In the field Project types next select Visual C#, in the field TemplatesConsole Application.

In a row Name enter the name of the program hello. Tse w im'ya z'appear in a row solution name. Take a tick off the field Create directory for Application(As long as we create a simple supplement, we don’t have the need to compose this structure).

in a row location select the location on the disk where you want to save your project. І press the button OK. The original view of the screen images in Figure 1.2


Rice. 1.2.

At the right upper part of the project management solution explorer View - Solution Explorer. Whomever has repaid all the resources to enter the project:

  1. AssemblyInfo.cs - information about folding.

    Compiler, as a result of his vikonannya, I create so called folding- A file with extensions exe or dll, which can be used to erase IL-code and metadata.

  2. System, System.Data, System.Xml - sent to standard libraries.
  3. Program.cs is the text of my C# program.

Respect. In other versions of VS, this includes a file with the ico extension, which is different for the type of program shortcut.

At the right lower part of the screen, the window of authorities is rotting Properties. Shut it down, you can turn it on with the command View-Properties. In this case, the most important characteristics of the seen element are shown.

The main space of the screen is occupied by the editor's window, in which the text of the program is placed, the creations of the middle are automatically. The text is a frame, in which programmer you will add the required code. When reserved, the words are in blue color, comments in green, the main text in black.

The text is structured. By clicking on the minus sign, we attach a block to the code, by clicking on the plus sign, we win.

Vіdkriєmo folder, scho mіstit project, we can look at its structure (div. Fig. 1.3). Files in bold font appear less after compilation.


Rice. 1.3.

At this stage, the following files are of particular interest to us:

  1. Hello.sln- The main file, a kind of support for the entire project. If you need to select a project for editing, you need to select the file itself. Other files are opened automatically.
  2. Program.cs- The file in which the output code is located - the code written by my C #. Same with the file mi and without intermediary pracyuvatimemo.
  3. hello.exe– a file that can generate IL-code and metadata for the project. In other words, this file is a ready-made program, which can be installed on any computer, on which the .Net platform is installed.

Now let's look at the text of the program.

using System- this is a directive, as it allows to win the names of standard classes from the space of names System without interruption, without offering a name to space, de stinks were appointed.

keyword namespace I create for the project my own expanse of names, which are called names for the project. Our speech has a wide range of names called Hello. However, the programmer may say otherwise. The expanse of names surrounds the sphere of zastosuvannya of names; It was created in order to be able to give names to program objects without interfering with the fact that stinks can be combined with names in other programs. In this way, the space of names allows the uniqueness of the conflict of names of software objects, which is especially important in the case of mutual additions.

C# is an object-oriented language, so the program will be written in a new language to bring together mutually exclusive classes. The class name Program was automatically created (in other versions of the environment, the class name Class1 can be created).

This class has only one method - the Main() method. The Main() method is the entry point of the program, so. The most important method is to get the program out of the way. The skin of my C# program is responsible for the Main() method.

Respect .Technically, it is possible to use the Main() method in one program, in which case it is necessary to use the C# compiler for the additional command line parameter, which is the Main() method itself as the program entry point.

Debug-Start Debugging If the program is hacked without pardons, then it will be displayed in the console window, like a main and shut down. To view the notes in normal mode, press the Ctrl+F5 keys or type the command Debug-Start Without Debugging.Our way of looking at the foot is the console window:

As if the program code for the pardon was missed, for example, a point was missed after which the command was removed, then after pressing the F5 key, a dialog box will appear, in which you will see information about those that have received a pardon, and food, to continue the work further. How do you know Yes, the version of the program will be compiled ahead of time. Otherwise, the process will be completed and the management will be transferred to the list of pardons error list.

manager. Change the text of the code so that the message appears on the screen: Hooray! Today's Informatics!!!

Doby all the best. To the call Oleksiy Gulinin. In this first article for C#, I want to tell you about the platform .NET Framework. The C# language and the platform itself first appeared in 2002. The main method of their creation was more simple, scaled, smut, tightened the programming model, aligned with the COM programming model. On the basis of the .NET Framework, you can run programs for the Windows family of operating systems, as well as programs for Unix, Linux, Mac OS X. list of features supported by the .NET Framework:

1) Possibility of interoperability with a clear code. This ability allows compiling, for example, two COM components and .NET components.
2) Support for different mov programming. .NET programs can be built with other programming languages, such as C#, Visual Basic, F#.
3) Zagalny vykonoyuchy mechanism. The sense here is that in .NET there is a simple set of types, a kind of building understanding of skin language, which supports .NET.
4) Move-in integration. You can write a Visual Basic class and then extend it in C#.
5) Great library of base classes. The leaders of our libraries can forget about collapsible implementations of low-level links to API-interfaces and just focus on programming.
6) Simple model of laryngeal. On the view of the COM library, .NET does not need to be registered at the registry. You can look at the assemblies.dll.

Possibly, here I have written about some unreasonable speeches, for example, class, API-interface. Get confused until the zim is not varto. In principle, you can program without knowing everything, but so, as we are with you, let's try to dilute practice with theory.
So we invite you to finish off the theory, let's talk about the main everyday blocks of the .NET platform:

1) CLR (Common Language Runtime) For the first time, the tasks of this medium are the concern and the management of .NET objects (so that the programmer does not rob it manually). Krim tsgogo, CLR dbaє about a number of low-level details, for example, memory management, program placement, conversions, related to safe programs.
2) CTS (Common Type System) - a common type system. Here are described all possible types of data, which are supported by the middle (CLR). It is necessary to know that the language is taken well, it can not be taken into account absolutely all the features assigned to the CTS specification. That is why:
3) CLS (Common Language Specification). It describes the anonymous types and programming constructs that are required to support all language programming for the .NET Framework platform.

In addition to the CLR and CTS/CLS specifications, the .NET platform hopes base class library, which is available for all .NET programming languages. This library allows a high level (without thinking about implementation details) to manage, for example, file input-output, graphics, various external attachments, data streams, and launch various services.

I'm not a master to write theory, I'll tell you, for those who want to understand the philosophy of .NET more deeply, I recommend reading the first section of the book by Andrew Troelsen "C# 5.0 and .NET 4.5 Language Development, 2013". This short information about the .NET platform is taken from the book. The problem, with which I zishtovhnuvsya schodo tsієї books, is the complexity of laying out the material for a beginner. Possibly, you won’t give up like that, the whole thing is my thought.

Well, my friends, haven't you had enough of C# yet? Then let's boldly go far, I promise that in the future there will be fewer theoretical articles (like only on the cob of C #), there is only one practice. What a theory is needed is to "smoke" a book by Endry Troelsen.
And so, as it is necessary as information for a class or yoga method, go immediately to

C#
  • Common Language Runtime) that class library...
  • .NET Framework and CTS specification
    Mova C# and її pіdtrimki nі nі vyazanі z platform .NET Framework, rozroblenu Microsoft. The platform is named (div. ) including: the glacially moving middle (CLR - Common Language Runtime Framework Class Library). Respect Varto...
    (PROGRAMMING. BASIC COURSE #)
  • Installing the .NET Framework and Visual Studio
    In the middle of Windows 7 and 8, the .NET platform does not need to install anything. To expand programs on the .NET platform, you need to install the Visual distribution system C# 2012 (or 2013) Express Edition - free version of the Visual Studio distribution medium (short, but may be practical...
    (Object Oriented Programming)
  • C# TYPES AND .NET FRAMEWORK PLATFORM TYPES
    Mova C# and її pіdtrimki nі nі vyazanі z platform .NET Framework, rozroblenu Microsoft. The platform is named (div. ) including: the glacially moving middle (CLR - Common Language Runtime) that class library...
    (PROGRAMMING. BASIC COURSE #)
  • .NET Framework and CTS specification
    Mova C# and її pіdtrimki nі nі vyazanі z platform .NET Framework, rozroblenu Microsoft. The platform is named (div. ) including: the glacially moving middle (CLR - Common Language Runtime) and class library (FCL - Framework Class Library). Respect Varto...
    (PROGRAMMING. BASIC COURSE #)
  • .NET Tipi

    The C# language can be used to create console programs - text programs that run on Windows DOS. Better for everything, such programs will be zastosovuvatsya for testing class libraries. However, more often than not, the C# language will be challenged to create programs that can access rich technologies related to .NET. This article provides a brief overview of various types of programs that can be written in C#.

    ASP.NET software creation

    The introduction of ASP.NET 1.0 fundamentally changed the web programming model. ASP.NET 4 is a major release of the product and encouragement on the basis of more resources. In ASP.NET 4, the main revolutionary features are implemented, aimed at improving the productivity of the work. The ASP.NET 4 head meta is to allow smarter, safer, more dynamic programs to use the least possible code.

    Possibility of ASP.NET

    First, i, possible, more important - all those that are on the side structured. Tobto skin side - tse, in essence, class, decline in .NET class System.Web.UI.Page, which can redefine the set of methods that are invoked at the hour of the life cycle of the Page object. (You can take the number of subdivisions as specific for the sides of the relatives of the subdivisions OnApplication_Startі OnSession_Start, which were found in the global.asax files in the classic ASP platform.) Some of the functionality of the sides can be seen in the descriptions of the main features, the ASP.NET sides are easier to understand.

    Another feature of the ASP.NET sides is that they can be created in Visual Sludio 2010 - the same middle, in which the business logic is programmed, and the data access components that are won by these ASP.NET sides. Visual Studio 2010 project or solution to mitigate all files associated with the plugin. What's more, the classic ASP-sides can be downloaded directly from the editor. In the old days, connected with Visual InterDev, there was an unacceptable need to specially configure InterDev and the web server for the project to enable the setup.

    For greater clarity of the code-behind code (code-behind) ASP.NET allows you to expand the structuring of the code further. ASP.NET allows you to isolate the server side functionality in a class, compiling that class at once with other sides into a DLL library and placing the DLL in the catalog, which is located below the HTML part. The @Page directive, written on the top of the page, associates this file with the class. When the browser asks for a sidebar, the web server generates a subclass for the class file, which is searched for by the sidebar class file.

    The rest, but not less important is the power of ASP.NET, as the next guess, the productivity is greater. At the same time, as the classic ASP-sides were interpreted with skin translation to the side, the ASP.NET sides after compilation are cached on the web server. Tse means that all requests of the ASP.NET sides are higher, lower first.

    ASP.NET also makes it easier to write sidebars that render forms in a browser, so you can type in corporate ones. The traditional thought about supplements, oriented to forms, is based on the fact that stinks give answers to the interface of the coristuvach, prote їх fold more support, shards of stink are launched on rich client machines. That is why people rely on supplements, oriented on forms, only once, if the interface is necessary and it is possible to provide a better support for the coristuvachas.

    Web forms

    To make it easier to design web pages, Visual Studio 2010 introduces the Web Forms library. This feature allows you to graphically create ASP.NET sides - just like Visual Basic 6 and C++Builder windows are created. In other words, it is necessary to drag the necessary elements of the keying from the toolbar to the surface of the form, then lightly correct the code of the form and write the code for the elements of the keying. When you use the C# mov to create a web form, you create a C# class, falling back to the base class Page, that side of ASP.NET, as it displays this class as its own code. Understandably, you are to blame for creating the web form in C# itself; for whom you can also use Visual Basic 2010, or be your own, oriented to .NET.

    In the past, the foldability of web development has emboldened the efforts of the distribution teams in the field of research and development. In order to achieve success, the development of web zastosunkіv had to know the impersonal different technologies, such as VBScript, ASP, DHTML, JavaScript, etc. Bringing Web Forms concepts to web pages has significantly eased the mindset of web add-ons.

    Elements of webserver care

    The checkout elements that are stuck in web forms are not the checkout elements in the same sense, as they are the ActiveX elements. Natomist stink is an XML-descriptor, which lies up to the scope of ASP.NET names, like a web browser dynamically transforms into HTML-descriptor that script of the client side, if it needs to ask the client side. It's amazing that a web server can display the same server-side keying elements in different ways, generating a transformation that matches a specific web browser, which is called upon. This means that now you can easily create perfect web page interfaces without worrying about how the page works in any available browser - about Web Forms.

    XML Web Services

    To this day, HTML-sides account for the majority of World Wide Web traffic. However, the XML computers are capable of adopting an independent format, which can be developed for their interoperability on the Internet. In the future, for the exchange of information, the computer may be able to victorize XML instead of translating one to one along the lines of support in a special proprietary format, similar to EDI (Electronic Data Interchange - electronic data exchange). XML web services are recognized for a service-oriented web environment, if remote computers give one to one dynamic information, as it can be parsed and reformatted, first take its remaining information for the core. XML Web Services is a simple way for computers to send information from XML forms to other computers on the Internet.

    In technical terminology, an XML web service in .NET is the side of ASP.NET that turns XML code into HTML code for client requests. Such parties rely on DLL-libraries of the given code, as a way to avenge the class, the decline of the WebService type. The Visual Studio 2010 integration environment introduces a mechanism that makes it easier to create web services.

    An enterprise or an organization can outperform XML Web services for two main reasons. The first reason is that stinks are based on HTTP; Web services can use HTTP-based media as intermediaries for transferring information. Another reason is that the XML Web Service shards are hosting XML, the format of the data being transferred is self-documenting, validating, and platform independent.

    Creation of Windows Forms

    Wanting C# i.NET recognized, zokrema, for web development, stench, like before, they add the title of an addendum to the "thrown" client - tobto. programs, as if they were due to be installed on the machine of a late coristuvach, de and more part of the work is done. This is where the Windows Forms Library (Windows Forms) comes into play.

    However, if you are fixing the .NET platform, I would not recommending Let's move on to Windows Forms, and now move on to the introduction of new WPF technology.

    Windows Presentation Foundation (WPF)

    One of the revolutionary new technologies is the Windows Presentation Foundation (WPF). When prompted by WPF additions, the XAML wiki spirals. The abbreviation XAML stands for Extensible Application Markup Language - language of markup of programs that expand. This new way of creating add-ons in the middle of the Microsoft medium, ahead of submissions in 2006, in a partial version. .NET Framework 3.0, 3.5 or 4. WPF programs are available for Windows 7, Windows Vista, Windows XP, Windows Server 2003 and Windows Server 2008 (only those operating systems allow the .NET Framework 3.0, 3.5 or 4 to be installed).

    XAML is XML verbosity, as it is designed to create forms, to represent all the visual aspects and behavior of WPF add-ons. Shards with the WPF add-on can be practiced programmatically, this technology is just like declarative programming, to which the whole bodice collapses today. Declarative programming means that instead of creating objects for additional writing of code compiled by me, such as C#, VB or Java, everyone is deafened for the help of XML-like programming.

    Windows Services

    The Windows Service (Windows Service, sometimes called NT Service) is a program designed to run in the background on Windows NT/2000/XP/2003/Vista/7 (not Windows 9x). These services are useful, if it is necessary to organize programs without interruption to the robot, as if ready to react on the sub, without the need for their explicit launch from the initiative of the coristuvacha. A good example is the World Wide Web Service on web servers to listen to clients.

    It's easy to expand my C# service. In the space of names System.Service.Process the base classes of the .NET environment are available, which allow you to override more template commands associated with system services. In addition, the Visual Studio .NET environment allows you to create a C# Windows Service project, which has C# source code for the Windows Service to be generated.

    Windows Communication Foundation (WCF)

    See how you can move data and services from one place to another, which are victorious in Microsoft technologies, you will see that your organization has a wide range of possible solutions. For example, you can hack ASP.NET Web Services, .NET Remoting, Enterprise Services, or MSMQ. How to choose the technology? The choice of nutrition is dictated by what you can achieve, the shards of skin technology are more important in a particular situation.

    Mindful of the fact, Microsoft deliberately took all these technologies together, and in version .NET Framework 3.0, as well as in її included in .NET Framework 3.5 and 4, є the only way to move data is Windows Communication Foundation (WCF). The WCF library ensures the possibility of the primary service with further delivery of the service in different ways (navigate for different protocols) with a simple change of the configuration file. WCF- more difficult new zasіb z'ednanny rozpodіlenih systems.

    Windows Workflow Foundation (WF)

    The Windows Workflow Foundation (WF) service was first introduced with the .NET Framework 3.0, but now it has experienced a groundbreaking, resulting in a lot of people who now know a lot of corruption. You can see that Visual Studio 2010 has significantly reduced WF workflows, and it has become more efficient to create workflows. You'll also find new flow control features like the Flowchart class, as well as newer ones like DoWhile, ForEach and ParallelForEach.

    It is one of the most requested, richly functional programming languages ​​that are actively developing at the moment. With the help of yoga, you can practically develop software security, starting from simple win forms add-ons, to the great client-server web add-ons or to develop mobile programs and computer games. And the wine is based on the .NET Framework platform. Let's figure out what it is.

    Watch my video on .NET Framework and CLR for C#

    Mova programming C#є visibly fresh, but vin has already earned the trust. The release of the first version came from the fierce 2002 rock. The latest version of the movie at the time of writing is C# 7.2, as of August 16, 2017.

    Syntax of C# mov like next to be included before the family of C-like mov and similar to other popular mov groups (C++, Java). Because you already know one of these languages, it will be much easier for you to master my C# programming.

    Oskіlki C# є object-oriented movoy, vіn pіdtrimu spadkuvannya, polimorfіzm, іncapsulation, strict typіzаtsіyu zmіnnih, vantagenny operіvіv іnshe. All the understandings will be reviewed by us in the upcoming articles. Using the paradigm of object-oriented design, with the help of movie programming, you can easily develop large-scale projects with a little help. With this, new versions of C# movies are regularly released, adding new functionality to simplify the life of the retailer, increase the speed of the development, increase productivity and reliability of the add-on.

    .NET platform

    .NET Framework – all software platform according to the company Microsoft which allows you to win the rozrobka with different language programs, so that for all the mov you can win the single main medium of the vikonnannya Common Language Runtime (CLR). Thus, the main features of the .NET platform are:

    • Cross-platform- .NET Framework supported by more modern operating systems Windows, as well as the ability to create programs that are supported by Linux systems, and launch mobile programs.
    • Multilingual-The vocals of the vihid code, the spelling of the mobage of the gesture, transluches, translucent into the monastery of the Common Intermediate Language (CIL) code, to be able to lead to a roser of the pydrimuvas of the Programuvni, I am a vicoristovyni movia movia. The most popular languages ​​that are supported are C#, VB.NET, C++, F#.
    • Great library of classes and technologies- There is a large number of ready-made libraries for the completion of the necessary tasks. We usually do not have to implement the low-level logic of robotic programs, rather quickly prepare solutions that are manually delivered through the nuget package manager. In addition, the .NET platform provides easy deployment of whatever type of software is needed.

    Kerning and non-kerning code. JIT compilation

    Kerirovany code (managed code)– the code of coding by the CLR core. Tse means that a certain middle ground can be used to understand the program and take specific information about the camp of the program at some point in the future. The original code of the movie is translated into CIL code (also called high-code assembler).

    After the class library is created, or the program's output code continues to save my CIL. And when you start the program or the link to the library, Just-In-Time is concatenated ( JIT) Compilation of programs in machine code, specific to the same honed, in which case the report is made. With this important feature, those that compile only those parts of the program or the library, to which the animal is victorious (that and zv'yazkіv, naturally). Tse allows you to increase the productivity of the robotic system and save resources.

    Unmanaged code- This code, which is translated directly into the machine's code and is victorious by the operating system without interruption.

    In addition, I recommend reading the article. And also subscribe to the VKontakte group, Telegram and YouTube channel. There is even more brown and yellow for programmers.

    © 2022 androidas.ru - All about Android