Write up on Tech Geek History : Utilizing .NET onto a SQL Server |Topic of Windows Forms (Winforms)

Literature Review

SQL Server is a database management system and not a database. An SQL Server database is a database maintained by SQL Server. SQL is a universal language for manipulating databases and is supported by most DBMSs—you’ll examine it in detail in Chapter 4, “Structured Query Language.” SQL retrieves selected records from the database and returns them to the client. Additionally, the language is capable of manipulating records—adding, updating, or deleting information within the database. Note A trial version of SQL Server 2000 is available from Microsoft at www.microsoft.com/sql. You aren’t limited only to SQL to access your data. Microsoft provides a programming model called ActiveX Data Objects (ADO) that provides an easy-to-use, object-oriented interface for data access. ADO.NET is the latest incarnation of ADO, providing backward compatibility with the classic ADO interface. DataSets and DataReaders comprise the heart of ADO.NET.

DataSets provide memory-resident copies of the data you need, along with the relationships and rules that surround that data. DataReaders provide fast access to forward-only, read-only data. You’ll learn more about ADO.NET soon, but first let’s discuss Microsoft’s view of data access. After you understand Microsoft’s data access strategy, you can apply it to the design and architecture of your systems. Microsoft Data Access Technologies Microsoft’s approach to data access hinges on the concept of distributed architecture. One of Microsoft’s long-term goals is the propagation of a common data store, and the advent of Universal Data Access (UDA) makes this possible. The advances made with ADO.NET extend this philosophy, in that the new data access model strongly supports interoperability, more than ever. Our intent in this section is to step through Microsoft’s data access technologies and then to identify how they fit into a distributed architecture. Windows DNA Windows DNA (WinDNA) stands for Distributed interNet Architecture, and it’s a methodology for building distributed applications. A methodology is a set of rules, or suggestions, rather than a blueprint for developing applications; in other words, it’s a recommendation on how to build distributed applications. A distributed application is one made up of multiple components that run on different machines. WinDNA is an umbrellaterm for distributed system methodology based on the Windows platform. WinDNA applications revolve around component-based architecture, specifically COM and COM+. Component-based architecture gives you great flexibility in many ways. You don’t have to build everything from scratch, as components offer black-box reuse. Components offer greater scalability, which comes from the modular, Lego-like capability

of components to plug and play into evolving functional systems. This modularity provides adaptability so that your application can change as business needs change. Finally, components make it easier to build distributed systems, enabling you to take advantage of processing power on other machines. WinDNA makes it easier to build distributed applications. We discuss distributed architecture in detail later in this chapter; however, realize that these different machines do not have to be limited to a single LAN; they can be spread throughout many networks. Because the Internet consists of multiple machines spread throughout the world, the Internet is a logical backbone for WinDNA applications. So, in effect, WinDNA is about building applications for the Internet. Interoperability plays a vital role in building efficient WinDNA applications. Interoperability comes from two levels: data and services. Microsoft addresses data interoperability issues with UDA, which was first introduced with WinDNA and matures with .NET. Microsoft addresses service interoperability with the .NET Framework. Although this book concentrates primarily on data architecture, you cannot build quality applications without understanding the services model introduced with .NET. The .NET Framework WinDNA uses an organic metaphor, with components representing the “cells” of a system. Each “cell” is responsible for a specific activity. Altogether, the “cells” can be viewed as a single entity, as a single system or “organism.” Under the WinDNA paradigm, it was difficult for organisms to communicate with one another. The .NET Framework provides the infrastructure, or nervous system, for organisms to talk to one another by using services. These services leverage the communication channels and formats that are already in place—the Internet and Extensible Markup Language (XML). Both WinDNA and the .NET Framework architectures are similar in the sense that they address distributed systems. However, there is one glaring difference between the two models: WinDNA is designed for tightly coupled component architecture, whereas the .NET Framework is designed for loosely coupled services. WinDNA components are strongly tied to their native applications, making remote access between systems a challenge. The .NET Framework lifts the wall between balkanized WinDNA components, liberating architecture for better communication between sites, services, and components. The Microsoft .NET platform evolves WinDNA, by addressing the system interoperability problem. Microsoft resolves this problem by extending the WinDNA component-based architecture to a services-based model. Although many companies have Internet systems, it is difficult for these systems to talk to one another. The services-based model presented with .NET enables heterogeneous applications services to talk by using these channels (see Table 1.1). Notice that all the technologies that .NET leverages are ubiquitous and nonproprietary.

What Are WebServices? In today’s web architecture, you build components that join DBMS and operating system functionality, along with custom business logic. These components emit HTML to browsers. They are not designed for communication between sites. The components of each site live in their own world, and many times developers resort to “screen-scraping” the HTML results, rather than calling the components directly. Microsoft WebServices provide a mechanism that enables intra-site communication using industry-accepted standards. Although WebServices are beginning to crop up for many technologies, Microsoft had not formalized the design, implementation, and delivery of their own WebServices until the release of the .NET Framework. Microsoft WebServices were introduced with the .NET platform as a way of publishing application logic as services via the Internet. Microsoft’s vision for WebService distribution and discovery will revolutionize the way we think about Internet architecture. Instead of trying to figure out how to access the functionality in external websites, you will be able to go to a centralized repository ( http://www.uddi.org) that contains all the published WebServices. All you have to do is select one for your application to use. Instead of messy Distributed Component Object Model (DCOM) code and type-libraries, all you have to do is simply point to the WebService of your choice and begin using it. We don’t get into too much detail here; suffice it to say that WebServices serve as modular contracts for communication between local and remote resources. WebServices use two ubiquitous standards—Hypertext Transfer Protocol (HTTP) and XML. These are both standard ways of communicating on the Internet. How Does .NET Fit into Data Access?

The data access services that come with .NET have matured quite considerably since Microsoft’s first introduction of UDA. The advancements in .NET data access center around the new Common Language Runtime (CLR) data types, .NET Framework base classes, and specifically the redesign of ADO into a more robust disconnected model. Data types have changed dramatically since Visual Basic 6 (VB6). The CLR houses a universal type system called the Common Type System (CTS), which is accessible by .NET-compliant languages. Warning Some features of the CLR are not supported by every language. For example, VB .NET does not understand the concept of unsigned integers. If you want to ensure crosslanguage support for your code, follow the guidelines in the Common Language Specification (CLS), which serves as a language-neutral subset of the CLR. The CLS extrapolates the common denominators between languages for support within the .NET Framework. XML is visible throughout the .NET data access libraries, not just as a supported technology, but as a cornerstone of the .NET Framework. Not only are XML functionalities housed in their own XML library, but they also are also a core foundation within the ADO.NET libraries. Table 1.2 shows some of the data access libraries within the System namespace that are shipped with the .NET

Framework. Table 1.2: New Data Access Libraries in the .NET Framework Data Access Library Description System.Data The main data access library for ADO.NET. System.Data.OleDb This library houses the components that provide access via an OLE DB provider. System.Data.SqlClient This library houses the data access components that are optimized for SQL Server. System.Xml This library contains the XML

Databases are the broadest and most diverse area of computer programming. Before you can understand how to design and develop database systems, you must first understand the big picture behind data access technology. You should then be able to use this knowledge to anticipate design considerations before you type a line of code. This chapter provides a high-level conceptual overview of data access technology and distributed architecture. This chapter is for those of you not familiar with such acronyms as OLE DB, ADO, DBMS, and UDA. You should read this chapter if you are not quite sure what n-tier means or are unfamiliar with designing distributed systems. Additionally, this chapter provides a historical glance back at Microsoft’s data access evolution, from classic ADO/OLE DB to ADO.NET within the .NET Framework. Databases and Database Management Systems A database is a system for storing structured information, which is organized and stored in a way that allows its quick and efficient retrieval. You need to put a lot of effort into designing a database so that you can retrieve the data easily. These operations are called queries, and there are two types of queries: selection queries, which extract information from the database, and action queries, which update the database.

How the DBMS maintains, updates, and retrieves this information is something that the application doesn’t have to deal with. Specifically, a DBMS provides the following functions: § A DBMS enables applications to use SQL statements to define the structure of a database. The subset of SQL statements that define or edit this structure is called Data Definition Language (DDL). Although all DBMSs use a visual interface with simple point-and-click operations to define the structure of the database, these tools translate the actions of the user into the appropriate DDL statements. SQL Server, for example, enables you to create databases by using a visual tool, the Enterprise Manager, but it also generates the equivalent DDL statements and stores them in a special file, called a script. § A DBMS enables applications to use SQL statements to manipulate the information stored in the database.

The subset of SQL statements that manipulate this information is known by another acronym: DML, which stands for Data Manipulation Language. Let’s come up with our own acronym to represent the basic DML operations: QUAD (query, update, add, and delete records). § A DBMS protects the integrity of the database by enforcing certain rules, which are incorporated into the design of the database. You can specify default values, prohibit certain fields from being empty, prevent the deletion of records that are linked to other records, and so on. Referential integrity enables you to build relationships between discrete data items. The relationships tie the data together, so that when data activity occurs, the related information is also affected.

 For example, you can tell the DBMS not to remove a customer if the customer is linked to one or more invoices. If you could remove the customer, that customer’s invoices would be “orphaned.” Referential integrity prevents orphaned records and undesirable deletions. § In addition, the DBMS is responsible for the security of the database (it protects the database from access by unauthorized users). The DBMS can provide security in many ways. It could integrate with the underlying operating system security, use the DBMS security model, or allow you to build your own custom security model. SQL Server is a database management system and not a database. An SQL Server database is a database maintained by SQL Server. SQL is a universal language for manipulating databases and is supported by most DBMSs—”Structured Query Language.” SQL retrieves selected records from the database and returns them to the client. Additionally, the language is capable of manipulating records—adding, updating, or deleting information within the database.

You aren’t limited only to SQL to access your data. Microsoft provides a programming model called ActiveX Data Objects (ADO) that provides an easy-to-use, object-oriented interface for data access. ADO.NET is the latest incarnation of ADO, providing backward compatibility with the classic ADO interface. DataSets and DataReaders comprise the heart of ADO.NET. DataSets provide memory-resident copies of the data you need, along with the relationships and rules that surround that data. DataReaders provide fast access to forward-only, read-only data. You’ll learn more about ADO.NET soon, but first let’s discuss Microsoft’s view of data access. After you understand Microsoft’s data access strategy, you can apply it to the design and architecture of your systems. Microsoft Data Access Technologies Microsoft’s approach to data access hinges on the concept of distributed architecture. One of Microsoft’s long-term goals is the propagation of a common data store, and the advent of Universal Data Access (UDA) makes this possible.

Nervous system In today’s web architecture, you build components that join DBMS and operating system functionality, along with custom business logic. These components emit HTML to browsers. They are not designed for communication between sites. The components of each site live in their own world, and many times developers resort to “screen-scraping” the HTML results, rather than calling the components directly. Microsoft WebServices provide a mechanism that enables intra-site communication using industry-accepted standards.

Although WebServices are beginning to crop up for many technologies, Microsoft had not formalized the design, implementation, and delivery of their own WebServices until the release of the .NET Framework. Microsoft WebServices were introduced with the .NET platform as a way of publishing application logic as services via the Internet. Microsoft’s vision for WebService distribution and discovery will revolutionize the way we think about Internet architecture. Instead of trying to figure out how to access the functionality in external websites, you will be able to go to a centralized repository ( http://www.uddi.org ) that contains all the published WebServices.

 All you have to do is select one for your application to use. Instead of messy Distributed Component Object Model (DCOM) code and type-libraries, all you have to do is simply point to the WebService of your choice and begin using it. We don’t get into too much detail here; suffice it to say that WebServices serve as modular contracts for communication between local and remote resources. WebServices use two ubiquitous standards—Hypertext Transfer Protocol (HTTP) and XML. These are both standard ways of communicating on the Internet. How Does .NET Fit into Data Access? The data access services that come with .NET have matured quite considerably since Microsoft’s first introduction of UDA. The advancements in .NET data access center around the new Common Language Runtime (CLR) data types, .NET Framework base classes, and specifically the redesign of ADO into a more robust disconnected model. Data types have changed dramatically since Visual Basic 6 (VB6). The CLR houses a universal type system called the Common Type System (CTS), which is accessible by .NET-compliant languages. Warning Some features of the CLR are not supported by every language. For example, VB .NET does not understand the concept of unsigned integers. If you want to ensure cross language support for your code, follow the guidelines in the Common Language Specification (CLS), which serves as a language-neutral subset of the CLR. The CLS extrapolates the common denominators between languages for support within the .NET Framework. XML is visible throughout the .

NET data access libraries, not just as a supported technology, but as a cornerstone of the .NET Framework. Not only are XML functionalities housed in their own XML library, but they also are also a core foundation within the ADO.NET libraries. New Data Access Libraries in the .NET Framework Data Access Library System.Data Description The main data access library for ADO.NET. System.Data.OleDb

This library houses the components that provide access via an OLE DB provider.

 System.Data.SqlClient This library houses the data access components that are optimized for SQL Server. System.Xml This library contains the XML Table 1.2: New Data Access Libraries in the .NET Framework Data Access Library components . Description XML fits into this model insofar as these libraries can bring back data in the form of XML.

You can use these libraries to build .NET WebServices. WebServices enable you to aggregate data from all over the Web, pulled from many devices. The client-server metaphor for data access is extinguished as we move to an environment where anything can be a data “server.” A client can now both consume and produce WebServices. So a client can be a server, and a server can be a client. Confused yet? It will all come together as you read through this book. In addition, .NET provides robust support for a disconnected environment. In fact, Microsoft completely redesigned ADO.NET, taking the best from ADO and tossing the rest. Because ADO had strong ties to a connected history, it never fully supported the disconnected environment. Microsoft developers followed a natural evolution from ADO 2. x. As WinDNA applications matured, developers began to see patterns of how applications used data. Developers began to build more-complex distributed applications, which caused speed to become a driving factor in design.

Disconnected RecordSets enhanced that speed. Hence, the .NET model fully supports disconnected environments with ADO.NET DataSets completely separated from the database access engine. We explain this concept further as we get deeper into ADO.NET in Chapter 6 , “A First Look at ADO.NET.”

The client application requests data from the database and displays it on one or more Windows Forms or Web Forms. After the data is on the client computer, your application can process it and present it in many ways. The client computer is quite capable of manipulating the data locally by using DataSets while the server remains uninvolved in the process due to the disconnected nature of DataSets.

 If the user edits the fields, the client posts a request via ADO.NET to update the database. Because the client directly instantiates its connections to the data source, you have tightly coupled communication between the client and the database server. The second tier is the database server, or the DBMS. This tier manipulates a complex object, the database, and offers a simplified view of the database through ADO.NET. Clients can make complicated requests, such as “Show me the names of the customers who have placed orders in excess of $100,000 in the last three months,” or “Show me the best-selling products in the state of California.”The DBMS receives many requests of this type from the clients, and it must service them all. Obviously, the DBMS can’t afford to process and present the data before passing it to the client. One client might map the data on a graph, another client might display the same data on a ListBox control, and so on. The server’s job is to extract the required data from the tables and furnish them to the client in the form of a disconnected DataSet. It simply transmits the DataSet to the client and lets the client process the information. The more powerful the client, the more it can do with the data.

By splitting the workload between clients and servers, you allow each application to do what it can do best. The DBMS runs on one of the fastest machines on the network, with the most storage capacity. The clients don’t have to be as powerful. In fact, there are two types of clients: thin and fat clients. Thin clients Thin clients are less-powerful interfaces that do very little processing on their own. A browser is a thin client, with its presentation capabilities determined by its current version or flavor. The benefits of thin clients are their cost (all you need to install is a browser) and their location transparency (they can access the database server from anywhere).

Thin clients are easy to maintain too, because most of the logic resides on a server, a fact that can lower the cost of deployment of the application. Fat clients A fat client usually runs on a desktop computer and leverages rich presentation features. Because client applications that run on fat clients are far more flexible and powerful, they require more expensive computers to run, and their proprietary interfaces often can’t be standardized. You can make them as elaborate as the available hardware and software language permits. The Three-Tier Model The two-tier model is an efficient architecture for database applications, but not always the best choice, because the architecture limits scalability. Most programmers develop two-tier applications that run on small local area networks. A more advanced form of database access is one that involves three tiers. Two-tiered modeling was popular until the emergence of the Internet, which introduced other physical tiers—the web and the application servers. As more and more developers ported logic to these servers, developers began to view this physical layer in a more logical way. This led to a vision of an Application layer as a distinct entity. The client server model unfurled into a three-layer logical model (also referred to as the three-tier model). Note In this book, we make a distinction between layers and tiers. For simplicity, a layer refers to a logical separation (for example, business, data, user). A tier refers to a physical separation (for example, DBMS, web server, stored procedures, DLL). Often, there is confusion about what n-tier really means. For the purposes of this book, n-tier is the physical distribution of tiers, which juxtaposes itself across the three logical layers. In the three tier model, each logical layer corresponds to a one-to-one mapping with the physical tiers. In two-tier, or client-server, architecture, the client talks directly to the database server. An application that directly connects to a data provider and retrieves some information, such as customer names or product prices, is a client-server application.

The role of the database server is to access and update the data. Everything else is left to the client. In other words, the client is responsible for presenting the data to the user, parsing user input, preparing the appropriate requests for the database server, and, finally, implementing the business rules. A business rule is a procedure specific to an entity, such as a corporation, industry or application. Your corporation, for example, might have rules for establishing the credit line of its customers. These rules must be translated into code, which is generally executed on the client in a two-tier model. Business rules change often, as they reflect business practices. New rules are introduced, and existing ones are revised. This means that the code that implements them is subject to frequent changes. If you implement business rules on the client, you must distribute new executables or libraries to the workstations and make sure all users are using the latest version of the client software (that is, your application). This is an awkward and inefficient delivery mechanism. If business rules are implemented on the database server, you avoid the problem of redistributing the application, but you place an additional burden on the database server, tying it to the processor with calculations that could better be performed on another machine. This leads naturally to the introduction of a third tier: the middle tier.

The middle tier is a layer that sits between the client application and the server, as depicted in. Generally a componentbased layer (in WinDNA), it exposes methods and properties that isolate the client from the server. If many clients need to calculate insurance premiums, you can implement the calculations in the middle tier. Client applications can call the methods of the objects that reside on the middle tier and get the results. The client application need not know how premiums are calculated or whether the calculations require any database access. All they need to know is the name of one or more methods of the objects that runs on the middle tier.

The three logical layers The main advantage of the middle tier is that it isolates the client from the server and centralizes the business rules. The client no longer directly accesses the database. Instead, it calls the methods exposed by the objects in the middle tier. A client application will eventually add a new customer to the database. Even this simple operation requires some validation. Is there a customer with the same key already in the database?

Did the user fail to supply values for the required fields (you can’t add a customer without a name, for example)? Adding orders to a database requires even more complicated validation. Do you have enough items of each product in stock to fill the order? And what do you do if you can fill only part of the order? A well-structured application implements these operations in the middle tier. The client application doesn’t have to know how each customer is stored in the database if it can call the Customer.AddNew() method, passing the values of the fields (customer name, address, phone numbers, and so on) as arguments. The middle tier will pass the information along to the Data layer, which will insert the new information to the database or raise an error if an error occurred. Likewise, the client application can pass all the information of the invoice to the middle tier component and let it determine the insertion of the new invoice. This action involves many tables. You might have to update the inventory, the customer’s balance, possibly update a list of bestselling products, and so on. The middle-tier component will take care of these operations for the client. As a result, the development of the client application is greatly simplified.

 The client will call the Invoice.AddNew() method and pass the ID of the customer who placed the order, the products and quantities ordered, and (optionally) the discount. Or, you might leave it up to the middle tier to calculate the discount based on the total amount or the items ordered.

The Invoice.AddNew() method must update multiple tables in a transaction. In other words, it must make sure that all the tables were updated, or none of them. If the program updates the customer’s balance, but fails to update the stock of the items ordered (or it updates the stock of only a few items), then the database will be left in an inconsistent state.

The program should make sure that either all actions succeed or they all fail. You can execute transactions from within your client-side code, but it’s a good idea to pass the responsibility of the transaction to a middle-tier component or the database server. The middle tier forces you to design your application before you start coding. If you choose to implement business rules as a middle tier, you must analyze the requirements of the application, implement and debug the middle-tier components, and then start coding the client application. By taking the time to do careful design in the middle-tier, you will find that those efforts will naturally transfer to designing a solid front end and back end, as well. Time spent in the early planning phases will not only save you hours of debugging effort, but will enable your application to have a longer lifetime. The middle tier can also save you a good deal of work when you decide to move the application to the Web. If the middle tier is already in place, you can use its components with a web interface. Let’s describe a component you will develop later in the book. A client application needs a function to retrieve books based on title keywords and/or author name(s). If you specify which of the search arguments are title keywords and which ones are author names, the operation is quite simple. As we’re sure you know, all electronic bookstores on the Web provide a box where you can enter any keyword and then search the database. The database server must use the keywords intelligently to retrieve the titles you’re interested in. If you think about this operation, you’ll realize that it’s not trivial. Building the appropriate SQL statement to retrieve the desired titles is fairly complicated. Moreover, you might have to revise the search algorithm as the database grows. Imagine that the same functionality is required from within both a client application that runs on the desktop and a client application that runs on the Internet (a web application). If you implement the

 SearchTitles() method as a middle-tier component, the same functionality will be available to all clients, whether they run on the desktop or the Web. You might wish to extend the search to multiple databases. You can easily handle this new case, by revising the code in a single place, the middle tier, and all the clients will be able to search all databases with the existing code. As long as you don’t add any new arguments to the

SearchTitles() method, the client will keep calling the same old function and be up to date. It is possible to write client applications that never connect to the database and are not even aware that they’re clients to a database server. If all the actions against the database take place through the middle tier, then the client’s code will not need to contain any database structures. As you can understand, it’s not feasible to expect that you can write a “database application without a database,” but the middle tier can handle many of the complicated tasks of accessing the database

https://library.uc.edu.kh/userfiles/pdf/52.Mastering%20Visual%20Basic%20.NET%20database%20programming.pdf

Significance of Study

Utilizing .NET onto a SQL Server |Topic of Windows Forms (Winforms) comes into play

Windows Forms is a UI technology for .NET, a set of managed libraries that simplify common app tasks such as reading and writing to the file system. When you use a development environment like Visual Studio, you can create Windows Forms smart-client apps that display information, request input from users, and communicate with remote computers over a network.

In Windows Forms, a form is a visual surface on which you display information to the user. You ordinarily build Windows Forms apps by adding controls to forms and developing responses to user actions, such as mouse clicks or key presses. A control is a discrete UI element that displays data or accepts data input.

NET includes the following components:

  • Runtime — executes application code.
  • Libraries — provide utility functionality like JSON parsing.
  • Compiler — compiles C# (and other languages) source code into (runtime) executable code.
  • SDK and other tools — enable building and monitoring apps with modern workflows.
  • App stacks — like ASP.NET Core and Windows Forms that enable writing apps.

The runtime, libraries, and languages are the pillars of the .NET stack. Higher-level components, like .NET tools, and app stacks, like ASP.NET Core, build on top of these pillars. C# is the primary programming language for .NET and much of .NET is written in C#.

C# is object-oriented and the runtime supports object orientation. C# requires garbage collection and the runtime provides a tracing garbage collector. The libraries (and also the app stacks) shape those capabilities into concepts and object models that enable developers to productively write algorithms in intuitive workflows.

The core libraries expose thousands of types, many of which integrate with and fuel the C# language. For example, C#’s foreach statement lets you enumerate arbitrary collections. Pattern-based optimizations enable collections like List<T> to be processed simply and efficiently. You can leave resource management up to garbage collection, but prompt cleanup is possible via IDisposable and direct language support in the using statement.

Support for doing multiple things at the same time is fundamental to practically all workloads. That could be client applications doing background processing while keeping the UI responsive, services handling many thousands of simultaneous requests, devices responding to a multitude of simultaneous stimuli, or high-powered machines parallelizing the processing of compute-intensive operations. Asynchronous programming support is a first-class feature of the C# programming language, which provides the async and await keywords that make it easy to write and compose asynchronous operations while still enjoying the full benefits of all the control flow constructs the language has to offer.

The type system offers significant breadth, catering somewhat equally to safety, descriptiveness, dynamism, and native interop. First and foremost, the type system enables an object-oriented programming model. It includes types, (single base class) inheritance, interfaces (including default method implementations), and virtual method dispatch to provide a sensible behavior for all the type layering that object orientation allows. Generic types are ubiquitous and let you specialize classes to one or more types.

The .NET runtime provides automatic memory management via a garbage collector. For any language, its memory management model is likely its most defining characteristic. This is true for .NET languages. .NET has a self-tuning, tracing GC. It aims to deliver “hands-off” use in the general case while offering configuration options for more extreme workloads. The current GC is the result of many years of investment and learnings from a multitude of workloads.

Value types and stack-allocated memory blocks offer more direct, low-level control over data and native platform interop, in contrast to .NET’s GC-managed types. Most of the primitive types in .NET, like integer types, are value types, and users can define their own types with similar semantics. Value types are fully supported through .NET’s generics system, meaning that generic types like List<T> can provide flat, no-overhead memory representations of value type collections.

Reflection is a “programs as data” paradigm, allowing one part of a program to dynamically query and invoke another, in terms of assemblies, types, and members. It’s particularly useful for late-bound programming models and tools.

Exceptions are the primary error handling model in .NET. Exceptions have the benefit that error information does not need to be represented in method signatures or handled by every method. Proper exception handling is essential for application reliability. To prevent your app from crashing, you can intentionally handle expected exceptions in your code. A crashed app is more reliable and diagnosable than an app with undefined behavior.

App stacks, like ASP.NET Core and Windows Forms, build on and take advantage of low-level libraries, language, and runtime. The app stacks define the way that apps are constructed and their lifecycle of execution.

The SDK and other tools enable a modern developer experience, both on a developer desktop and for continuous integration (CI). The modern developer experience includes building, analyzing, and testing code. .NET projects can often be built by a single dotnet build command, which orchestrates restoring NuGet packages and building dependencies.

References

https://library.uc.edu.kh/userfiles/pdf/52.Mastering%20Visual%20Basic%20.NET%20database%20programming.pdf

Leave a Comment

Your email address will not be published. Required fields are marked *