StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

The Major Goal of LINQ to SQL: Relational Databases and the Programming Logic - Essay Example

Cite this document
Summary
The paper describes the main problems facing software development in the modern era. Dot Net is very much a product in evolution with each version correcting design features and adding enhancements to increase ease of use, scalability, portability and adaptability…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER96.8% of users find it useful
The Major Goal of LINQ to SQL: Relational Databases and the Programming Logic
Read Text Preview

Extract of sample "The Major Goal of LINQ to SQL: Relational Databases and the Programming Logic"

Perhaps the main problems facing software development in the modern era are the issues of: 1. the need for the simplification in the development and re-use of common code modules; 2. the presence of a number of different code execution environments that any code developed might be run on; 3. dealing with the issue of the presence of a number of different computer languages in general use and the varying levels of competencies that may exist within any talent pool available; 4. accounting for the continuing evolution of both the conceptual framework of the science of program development itself and the actual environments in which programmatic modules themselves will be executed in, i.e. the desktop environment and the internet; 5. and lastly, the recognition of the need for a means to allow for the continual growth and development of any set of solutions that account for the issue mentioned above. It was in recognition of the factors that led to the development of what is now known as .Net (“Dot Net”). Overview Dot Net 1.0 was released in early 2001 and since then has gone through several iterations (1.1, 2.0, 3.0, 3.5, and recently 4.0). Dot Net is very much a product in evolution with each version correcting design features and adding enhancements to increase ease of use, scalability, portability and adaptability to the evolving needs of Internet commerce and connectivity. One of the main features of Dot Net 3.5 is the addition of a data access method known as LINQ (Language Integrated Query), which is meant to be a easy to use replacement for the SQL technique for accessing data, not limited to, but including relational data as contained in a database repository such as SQL Server, as well as data contained in XML format files, and in memory arrays. The core features of Dot Net are the common language runtime (CLR) and the .NET Framework class library. Within these feature are constructs specifically designed to account for each of the issues described above. Common Language Runtime The CLR is an interesting invention. It’s main purpose is to account for item #2 mentioned above, specifically, the existence of a number of different computer languages that are in common use today such as C++, BASIC (VB.NET), C# ( a language similar to Java and C++ and taking the best features of each), Java, and several others. The CLR main purpose is to make application development and execution neutral across each of these languages. The CLR also provides features such as exception handling, garbage collection, security, and interoperability. Exception handling is providing the ability for a program to gracefully deal with the failure of a sub-process without exiting abruptly and garbage collection is the ability of a program to quietly release and destroy memory allocations when the need for those allocations is passed without their explicit release by the program. Both of these features are specifically designed to account for item #3 above, i.e., the likelihood of differing levels of programmer competency being present in a development environment. Assemblies in the Common Language Runtime The CLR is located in what is known as “assemblies” , which can be considered as similar to DLLs, in that assemblies are stored in the Portable Executable (PE) format, common on the Windows platform for all DLL and EXE files. but which provide much enhanced capabilities such as Code Access Security and verification and validation. Three-Tier Architecture The rigorous application of a n-tiered approach to web application development using Dot Net satisfies item #4 above. An N-tier application is anything that is divided into discrete logical parts such as separate presentation, business, and data layers. The most common choice is where tier 1 handles presentation, tier 2 handles business logic, and tier 3 houses the data (web servers, application servers, and data servers. The use of three tier architecture greatly facilitates both ease of development. Ease of development is facilitated by the use of separate tiers which may be handled by assigning several different programmers of varying skill levels to each tier and the procedures and functions within each. In addition, three tier architecture also contributes to ease of development by making it possible to use ready made components that may be bought or contracted out to third parties. The presence of Master page support in Asp.Net , which permits the use of generic template pages greatly helps in web application development by allowing web page designers to focus on the specifics of each novel page while maintaining a constant look and feel across the particular application. EFFICIENT MAINTENANCE Overview One of the main disadvantages of traditional style programming pre mid-1990’s was the often severe difficulty of maintaining previously developed software either by the original programmer or any other programmer assigned later to the task of maintenance. With the evolution of Object Oriented Programming (OOP) much of this problem has been eliminated, and this particularly so in the case of the Dot Net environment and the application of 3-tier design and programming techniques. Common Language Runtime The CLR is the primary vehicle for resolving many of the issues of efficient maintenance of pre-existing software within Dot Net. It provides strong data typing and easy method-based programming language syntax. Managed code is the term used by Microsoft to identify computer program code that requires and will only execute under the "management" of a Common Language Runtime virtual machine. The benefits of using managed code include programmer convenience (by increasing the level of abstraction, and creating smaller models) and also providing enhanced security. Built-in security using code access enhances application security and also helps avoid buffer overruns. Each of these contributes to reduced maintenance and headaches costs. Having the CLR also contributes to ease of deployment and the vastly improved versioning facilities-the end of "DLL hell", which greatly reduces maintenance problems. Assemblies in the Common Language Runtime The assembly is the logical unit of deployment in the .Net environment. It contains the Manifest, Metadata, Microsoft intermediate language (MSIL) and resources. The Manifest is a data store that contains metadata about the components in an assembly (version, types, dependencies, etc). The Metadata- is a data type that completely describes all types defined in an assembly: properties, methods, arguments, return values, attributes, base class. Examining the information in the Assembly can greatly facilitate code maintenance and also development. .Net provides an intrinsic class known as “Reflection” which can be very productively used to assist in code maintenance. Three-Tier Architecture The use of three tier architecture greatly facilitates code maintenance. Code maintenance is facilitated by the fact that particular code modules may be modified or enhanced without affecting the functionality of any other component of the application. SCALABILITY Overview It may be difficult for a manager to estimate at the time of development of an application targeted for the Internet exactly how much traffic that application might expect in its production state. However the .NET Framework make this problem quite a bit easier to manage. Some of the techniques specific to .Net are: Pipeline optimization, Process Model configuration, tweaking of the web.config file, caching, load balancing, Conceptual The basic idea here is that it would be extremely advantageous for a heavily utilized web application to be constructed in such a way that it might be 1. distributed over multiple servers 2. designed in such a way that some of Dot Net internal components or configuration instructions are optimized 3. designed in such a way that some of the internal Dot Net components or configuration instructions are left out of the final version of a distributed application. Common Language Runtime Since ASP.NET is running on top of the CLR, it is possible to profile a web page completely, from its entry point, through any middle tier objects to its end. Assemblies in the Common Language Runtime One feature of the CLR that affects the issue of scalability is the fact that the presence of the CLR removes the issue once known as “Dll hell” so that an application can have side-by-side versions of shared components which can be installed by the simple use of “Xcopy” function , so deployment is much simplified. Other features of the CLR that impinge on scalability are: 1. .Net developed applications can be used on platforms ranging from smart handheld devices all the way up to applications running on huge Web Farm 2. .Net CLR automatic memory management makes the extension of an application from running on a single processor to one running on multiple machines a relatively simple process, in addition- 3. .Net memory management is automatic and self-configuring. The process of reclaiming memory that is no longer being actively used (garbage collection) is highly optimized, thereby removing one of the main stumbling blocks to efficiently scaling internet applications. 4. The .Net CLR also works to dynamically tune memory usage through a Least Recently Used (LRU) algorithm that discards the least recently used memory items first. This works to enhance scalability by removing the need for manual adjustment of memory needs. 5. in the .Net CLR the thread pool provides a convenient way to manage multiple threads. A thread represents a part of a program which can be run independently. It is also the basic unit to which an operating system allocates processor time. The CLR uses threads to perform tasks asynchronously and to multiplex multiple operations concurrently and automatically. This works to enhance scalability by making concurrency possible on multiple processors and processor cores. 6. in the .Net CLR the presence of Asynchronous Messaging can provide opportunities for increased parallelism across multiple processors and processor cores. 7. Object remoting is a integral feature of the CLR that allows for communication between multiple application domains either in the same process, different processes, the same machine, or on different machines. This is directly relevant to the issue of scalability. Three-Tier Architecture In maintaining an application the use of three-tier architecture, separating business logic layer from presentation layer and that from the data layer allows programmers with specific expertise in each area to focus on their area of expertise, and allow the application designer to target each layer to a specific application domain. Comparison The major goal of LINQ to SQL is to provide consistency between relational databases and the programming logic used to interact with them. For example, rather than representing database queries using a big clunky SQL string, we can use strongly typed LINQ queries. When programming with LINQ to SQL, you see no trace of common ADO.NET types such as SqlConnection, SqlCommand, or SqlDataAdapter. In ADO.NET you would do something like this to connect to a database and retrieve the data in a 3-tier type project: Dim myDataSet As DataSet = New DataSet() Dim connection As String = MainConnectionString" Dim sql As String = "Select * from sometable Where ID = " + Id.ToString Try Using myConnection As New MySqlConnection(AppConfiguration.ConnectionString(connection, 1)) Dim myCommand As MySqlCommand = New MySqlCommand(sql, myConnection) myCommand.CommandType = CommandType.Text Dim myDataAdapter As MySqlDataAdapter = New MySqlDataAdapter() myDataAdapter.SelectCommand = myCommand myDataAdapter.Fill(myDataSet) myConnection.Close() Return myDataSet End Using Catch ex As Exception Throw End Try However, in LINQ there is a different mechanism to connect to the and this mechanism is the DataContext class. The DataContext class talks to the database, retrieves data, and submits changes back to the database. To create a DataContext object, pass a string with the information about the database server, the specific database, and your credentials to the DataContext class’s constructor, as shown here: Dim db As New DataContext(”Data Source=localhost;initial catalog=northwind;Integrated Security=True”) The LINQ API allows you to interact with a relational database by abstracting away the underlying ADO.NET data types as demonstrated above (connections, commands, data adapters, etc.) through the use of entity classes. Another great advantage of LINQ is that rather than having to treat relational data as a stream of records, you can interact with the data using standard object-oriented programming techniques. Because LINQ to SQL allows integration directly within our VB code base, the need to manually build many f custom classes and data access libraries to complex hide ADO.NET code from view is greatly minimized. Using LINQ query expressions, entity classes, and the DataContext type, you are able to perform all the expected database operations, as well as define transactional contexts, create new database entities (or entire databases), invoke stored procedures, and perform other database-centric activities. Furthermore, the LINQ to SQL types (again, such as DataContext) have been developed to integrate with standard ADO.NET data types avoiding much programming hassle. However, the main advantages of ADO.NET is that it can be applied to databases other than SQL Server, such as MySQL or Oracle. This is actually a big issue, since the cost factor of using Microsoft SQL Server compared to MySQL is substantial, considering that MySQL is basically free and offers essentially equivalent features to SQL Server while SQL Server has substantial licensing costs and requirements. However, aside from the alternative database issue, using ADO.NET is disadvantageous since one must always be careful of data types in code processing, and also that you cannot programmatically interact with a database at the native language level. With LINQ you an handle not only relational data, but also XML, Objects, DataSets, Collections, and Entities. LINQ to Objects is the name given to the IEnumerable API for the Standard Query Operators. This feature allows you to perform queries against arrays and in-memory data collections which may have been returned from prior database queries and are held in memory or perhaps in a Session Object variable Also LINQ can be easily applied to previously developed that relies on DataSets and virtually any other data store would make a good candidate for supporting LINQ queries. This includes databases, Microsoft’s Active Directory, the registry, the file system, or even an Excel file, In terms of development and maintenance with LINQ you get language-level support, which includes syntax checking and IntelliSense. You do not have to worry about writing a SQL query into a string and not detecting a syntax error until runtime. It helps that IntelliSense will show the table’s fields to you. .NET SPECIAL FEATURES Two features of Dot Net that contribute to enhanced functionality and portability are: SQL Server 2005 CLR Integration Being able to develop routines in .NET languages that run within SQL Server's process space gives developers the ability to create new kinds of custom methods. THE NGEN utility NGEN.exe is a .NET utility that post-compiles the application at install time. Post-compiling improves start-up performance for managed code, while maintaining all the security and stability advantages of managed assemblies.Methods are JITed when they are first used, incurring a larger startup penalty if the application calls many methods during start-up. Because Windows Forms uses many shared libraries in the operating system, post compiling Windows Forms applications usually improves performance. Post compiling also makes sure that the application is optimized for the hardware on which it is being installed. Sources Petroutsos, Evangelos. Mastering Microsoft Visual Basic. Indianapolis, Indiana: Wiley Publishing, Inc., 2008. Troelsen, Andrew. Pro VB 2008 and the .NET 3.5 Platform. New York: Springer Verlag 2008. Spaanjaars, Wilton, Livermore. ASP.NET 2.0 Instant Results . Indianapolis: Wiley Publishing, Inc., 2006 Agarwal Huddlestonet et al. Beginning C# 2008 Databases: From Novice to Professional. New York: Springer-Verlag, 2008 Stephens, Rod. Visual Basic® 2008 Programmer’s Reference. Indianapolis: Wiley Publishing, Inc., 2008 Hamilton, Bill. ADO.NET 3.5 Cookbook, 2nd Edition. Sebastopol: O'Reilly Media, Inc 2008 Walkthrough: Creating LINQ to SQL Classes (O/R Designer) . .NET Framework Conceptual Overview Read More
Tags
Cite this document
  • APA
  • MLA
  • CHICAGO
(The Major Goal of LINQ to SQL: Relational Databases and the Essay, n.d.)
The Major Goal of LINQ to SQL: Relational Databases and the Essay. Retrieved from https://studentshare.org/technology/1736347-dotnet-and-linq-fit-for-purpose
(The Major Goal of LINQ to SQL: Relational Databases and the Essay)
The Major Goal of LINQ to SQL: Relational Databases and the Essay. https://studentshare.org/technology/1736347-dotnet-and-linq-fit-for-purpose.
“The Major Goal of LINQ to SQL: Relational Databases and the Essay”, n.d. https://studentshare.org/technology/1736347-dotnet-and-linq-fit-for-purpose.
  • Cited: 0 times

CHECK THESE SAMPLES OF The Major Goal of LINQ to SQL: Relational Databases and the Programming Logic

Database Systems and Open Sourcing

ET, the use of sub-queries, creating and using stored procedures (sprocs), other T-SQL programming elements available for use in sproc, and Visual Basic and C# syntax required in employing sprocs in your applications.... SQL or Structured Query Language is a programming language designed for CRUD (Create, Read, Update, and Delete) operations on table data.... ET, the use of sub-queries, creating and using stored procedures (sprocs), other T-SQL programming elements available for use in sproc, and Visual Basic and C# syntax required in employing sprocs in your applications....
2 Pages (500 words) Research Paper

Relational Database Assignment

relational Database Importance of Relationships in Database Design Relationships play an extremely important role in the design of a database.... A relationship is a prime component of the relational database as it develops an association between the logically related pair of tables.... Division of the elements of a data into the related tables is one of the most challenging tasks of designing a relational database.... Relationships are the cornerstone when the normalized tables play the role of foundations of the relational database Relationships also help prevent the redundant data in a relational database (Microsoft Support, 2011)....
3 Pages (750 words) Assignment

Database Design & Development

It is a database management system that is based on a popular model of relational model.... It is a DBMS that manages… RDBMS is based on the concept of relational system, referential integrity and normalization (Chaterjee 2005).... Enterprise systems are usually based on relational database.... Main features of RDBMS; It can be defined as a relational model database server, which organizes data at in one centralized point for multi-user access....
4 Pages (1000 words) Essay

Discuss the types of relational databases and their advantages

In TYPES OF relational databases IN THEIR ADVANTAGES Types of relational databases in their advantages Affiliation A relational database stores all the data in tables.... n relational databases, normalization plays a very important role.... In addition, the relational activities, facilitated by the relational databases work in an excellent way with normalized tables.... Additionally, relational databases support dynamic views, which is an important concept of databases....
1 Pages (250 words) Essay

SQL/PL Database project

Oracle Database 11g PL/SQL programming Workbook, 2010 Print... For example, Triggers in PL/sql are the special stored programs which are triggered by… Triggers run between the issuance of a command and database management action is performed.... In the Yours PL/sql Project Row Type: The %ROWTYPE is used to specify the field of data types taken from columns of the views or tables.... For example, Triggers:Triggers in PL/sql are the special stored programs which are triggered by the use of events for the given program....
1 Pages (250 words) Essay

Structured Query Language Database

First normal form (1NF) and second normal form (2NF). The goal of conforming the… The attributes tours sold repeats itself twice in the initial data model.... The normalization process will be done in two phases i.... .... The first step will form a new separate table for the tours sold table with the customerId field as the primary key of the customer table and The customerID field is a unique area because each customer will have their unique customerID thus the reason for its use as the primary key....
3 Pages (750 words) Essay

Introduction to Database Systems

User defined functions are routines that encapsulate SQ logic inside them.... Functions are divided into scalar function (return a single value), in-line functions ( return a table) and table value function for complex logic and multiple operations.... Stored procedure is an sql code or object that is executed like a query several times in order to achieve different functions or purposes.... Stored procedures contain a procedure name, input/output parameters, and a procedure body. User defined Insert sql Stored Procedure and Functions Stored procedures in sql is a collection of controls, condition handling and sql statements that provide an interface to the database....
1 Pages (250 words) Essay

Paperless office database - Topic title

databases further encourage validation of data, segmentation of consumers and proper organization of data in the media industry.... Thus, a relational database management system is required.... Further, the nature of the data they process is diverse and requires reliable means to store it in a minimal form like using relational database.... Further, it seeks to induce a lot of security to the data it gets in and out of the organization by preventing sql Injection....
2 Pages (500 words) Coursework
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us