LINQ ROX! Integrating LINQ into the Database ...

4 downloads 3089 Views 474KB Size Report
providers for LINQ to query: Amazon [16], Google, mySQL, ..... LINQ is declarative, a developer must still be aware of its .... Oracle Sun Developer Network. 2007.
LINQ ROX! Integrating LINQ into the Database Curriculum Suzanne W. Dietrich 1 [email protected]

Mahesh Chaudhari 1,2 [email protected]

1

2

Division of Mathematical and Natural Sciences Arizona State University

School of Computing, Information, and Decision Systems Engineering

Phoenix, AZ 85069-7100

Arizona State University Tempe, AZ 85287-8809 In an ORM, annotations within the class definition provide a mapping between the objects and relations. LINQ [6], which stands for Language INtegrated Query, is a declarative query language that is seamlessly integrated into object-oriented programming languages supported by the .NET Framework. LINQ is more than an ORM approach, since LINQ can query data stored as relations, objects, and XML (ROX).

ABSTRACT The Language INtegrated Query (LINQ) language is a declarative query language integrated within an object-oriented programming language that provides a unified paradigm for querying relations, objects, and XML (ROX). This paper describes a suite of exercises, from cooperative in-class activities to larger-scale graded assignments, for incorporating LINQ into the database curriculum. These exercises support various student learning outcomes and illustrate the applicability of LINQ by querying the same database enterprise across the ROX data models.

Several questions may arise at this point. Does LINQ replace SQL? No. LINQ works with the industry-standard SQL. LINQ queries over relational data sources are automatically converted to SQL by the underlying framework. Is LINQ a fad? No. LINQ bridges the gap between databases and OOPLs. LINQ promises to be successful based on its underlying formalism of functional programming and its extensibility to define query providers. What about LINQ being proprietary to Microsoft technologies? Besides the (default) query providers that allow LINQ to query objects, relations, and XML, third parties are already building query providers for LINQ to query: Amazon [16], Google, mySQL, PostgreSQL, and Oracle [6]. Also, LINQ has been successfully used in applications developed in a UNIX-based operating system using the Mono [19] library, which is an open-source implementation of the .NET framework for building crossplatform applications.

Categories and Subject Descriptors H.2.3 [Database Management]: Languages – Query languages. K.3.2 [Computers and Education]: Computer and Information Science Education – Computer science education.

General Terms Languages

Keywords Databases, Object Relational Mapping, LINQ, SQL, XML

1.

There has been some literature describing the use of LINQ as an object query language in a database course [10] and as a gentle introduction to XML and databases [11]. The goal of this paper is to describe the experience with various exercises across the ROX paradigms to illustrate how LINQ may be incorporated into an already crowded database curriculum [2]. The LINQ framework is briefly introduced in Section 2 along with the database enterprise. Sections 3 through 5 describe the various exercises and learning outcomes for LINQ to Objects, LINQ to SQL, and LINQ to XML, respectively. These exercises range from cooperative in-class activities to larger-scale graded assignments and can be tailored by the database educator to fit their needs. These exercises have been incorporated across various courses in a database curriculum, and a discussion of this LINQ experience concludes the paper in Section 6.

INTRODUCTION

Today’s applications typically require the integration of relational and XML data within an object-oriented programming language (OOPL). The interaction between the underlying OOPL and the data has typically been managed by providing a call-level interface, which has a specific application programming interface (API) that the programmer uses to orchestrate the interactions between the OOPL and the data using method calls and string representations of queries. Besides call-level interfaces, there are several object-relational mapping (ORM) approaches that introduce a layer of abstraction to integrate the OOPL and the relational database, such as the Java Persistence API (JPA) [20]. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SIGCSE’11, March 9–12, 2011, Dallas, Texas, USA. Copyright 2011 ACM 978-1-4503-0500-6/11/03…$5.00.

2. LINQ OVERVIEW LINQ’s integration into imperative languages (e.g., C# and Visual Basic) of the .NET Framework 3.5 is based on a framework of language extensions, which include implicitly typed local

293

variables, extension methods, object initializers, anonymous types, and lambda expressions.

C# uses the => syntax for lambda expressions that allow for the passing of parameters to anonymous functions, such as passing the employee to the anonymous filtering predicate in the Where extension method. The full details of LINQ are beyond the scope of this paper. Readers are referred to papers for database educators [10] and books [6, 16] for more information. However, there are sample LINQ queries used throughout the presented exercises that will provide additional insight into the LINQ language.

The paper uses the EMPLOYEE TRAINING enterprise from [9] as a scenario to illustrate the use of LINQ over ROX. The enterprise maintains a record of the training courses taken by employees. Each training course is associated with one technology area, and a technology area has a designated employee as a leader. Figure 1 provides a corresponding UML class diagram. The Takes class represents an association class, storing the date that an Employee took the TrainingCourse. The representation of Takes as a reified association facilitates the discussion of the enterprise across all three data models.

For all of the exercises presented in the following sections, the free LINQPad tool [4] provides a formative environment for students to learn and use LINQ. LINQPad provides a lightweight interactive development environment for students to experiment with LINQ in C# (as an alternative to using Visual Studio). LINQPad also supports all three ROX paradigms for querying in LINQ. (Sample files are made available on the author’s Web site.)

3. LINQ TO OBJECTS Learning outcomes for coverage of object-oriented databases (OODB) usually include the implementation of an inherently object-oriented enterprise using an OODB. A typical approach is to have students use in-memory objects first and then to extend the assignment to a persistent OODB, such as the open-source db4o database [8]. Once the classes have been implemented and verified with the conceptual model, the database must be populated. Using the object initialization feature, properties can be initialized by name rather than by position as with a typical constructor: var emp111 = new Employee { eID = “emp111”, … }; var emp321 = new Employee { eID = “emp321”, … }; var dbArea = new TechnologyArea { aTitle = “Database”, … };

Figure 1. Employee Training UML Class Diagram As an example, consider the following LINQ query expression that returns employees who earn more than $75,000, displaying the result in descending order by salary: var empsMoreThan75K = from e in employees where e.eSalary > 75000 orderby e.eSalary descending select new { salary = e.eSalary, name = e.eLast + ", " + e.eFirst, title = e.eTitle };

In OODBs, there is usually a mechanism to refer to the collection of objects of a particular type, known as an extent, to facilitate querying the database. For an in-memory implementation, an employees extent can be defined using an array: Employee[] employees = { emp111, emp321, … }; For a persistent OODB implementation, there is no need to create an extent as the database automatically provides this capability. Assuming that the variable db references a db4o database, the Set method stores the object in the database (e.g., db.Store(emp111)), and the Query method retrieves objects from the database (e.g., db.Query() retrieves all Employee objects). To provide a name for the extent, a simple LINQ query can be posed: var employees = from e in db.Query() select e;

This query illustrates the query comprehension syntax of LINQ that resembles SQL clauses, although the order of the clauses corresponds to the underlying evaluation. The var keyword allows the declaration of implicitly typed variables whose type is derived from the LINQ query expression. The select clause in the above example illustrates the use of anonymous types and object initialization, since the type returned is created on the fly and this anonymous type is initialized using the by name object initialization feature.

Once the database is populated, the database instance should be validated. In SQL, the primary key, unique, not null, and referential integrity constraints are specified as part of the DDL. In an OODB, the data definition language is the programming language, and OOPLs do not inherently support all of these database constraints. Before the DDL was added to the SQL standard in 1992, these constraints were verified using queries over the relational database. Similarly, the students can write LINQ queries to verify these constraints on an OODB. Figure 2 provides a sample collection of validation rules for the employees extent that extends an example found on the Web [5]. The original example validated one employee for non-null and non-empty strings as well as constraints on numeric fields. Figure 2 also illustrates primary key/uniqueness, participation, and cardinality constraints. The variable invalidEmployees returns a collection of Employee instances that do not satisfy all of the validation rules.

The query comprehension syntax is converted to the underlying functional extension method syntax, where the familiar SQL keywords are implemented as extension methods. An extension method is a static method of another class that can be called as an instance method of the class itself. The extension method syntax for the above LINQ query is: employees .Where(e => (e.eSalary>75000)) .OrderByDescending(e => e.eSalary) .Select(e => new { salary = e.eSalary, name = ((e.eLast + ", ") + e.eFirst), title = e.eTitle } )

294

Before using LINQ, the object database curriculum necessarily had more of an emphasis on OOPLs, since the OOPL is the language used to define, populate, validate, and query the database. With the introduction of LINQ and the availability of the LINQPad tool for formative feedback, students now have the opportunity to more easily experience a declarative query language for objects, since the OQL standard [7] was only available in research prototypes. Now the OODB coverage emphasizes the declarative features of LINQ for validation and querying, and student projects use LINQ as a declarative query language with the db4o OODB.

Func[] validEmployeeRules = { // String not null validation: repeat for each String e => !String.IsNullOrEmpty(e.eID), … // not null: repeat for each required reference property // participation is not required in leads or takesCourses // validate numeric values e => e.eSalary > 0, // uniqueness constraint e => (from Employee emp in employees where emp.eID == e.eID select emp).Count()==1, // Verify instance of 1:1 relationship e => e.leads == null || e.leads.leader == e, // lazy evaluation // Verify instance of M:1 relationship e => (from Takes t in e.takesCourses select t.emp).All(te => te == e) };

If there is not enough time to have the students implement the scenario and the learning outcome is to query an OODB using LINQ, a verified implementation and population of main memory objects can be given to the students as the basis for querying. The implementation of the classes can be supplied as a dll file, and a LINQ file provided for population and verification. Students can then be given a short assignment to answer queries over objects in main memory to explore the LINQ language.

var invalidEmployees = from Employee e in employees where !validEmployeeRules.All(rule => rule(e)) select e;

LINQ can also be explored in the context of LINQ to SQL, where the from clause iterates over the tuples of a table.

4. LINQ TO SQL

Figure 2. Validation Rules for Employees

Since OOPLs are used to implement today’s applications, it is important for students to experience an ORM approach to querying relational databases as a learning outcome for an advanced database course. LINQ to SQL is an ORM approach that can be viewed as automatically creating wrapper objects for the relations and allowing for the attributes to be referenced using dot notation.

The primary key or uniqueness constraint verifies that there is only one Employee object with the eID of the employee e by checking that the count of objects with that eID is 1. Referential integrity constraints are inherent in the specification of the underlying object model. For example, the leader property for the TechnologyArea is a reference to an Employee. For required or total participation in an association, a validation rule checks that a property is not null, such as the leader property for TechnologyArea.

Students in a typical database course will have an assignment to query a relational database in SQL to answer various types of queries, involving select-project-join (SPJ), negation, aggregation (count, min, max, sum, avg), grouping, and division. These same queries can be used in a companion LINQ assignment. Figure 3 gives the relational schema for the EMPLOYEE TRAINING enterprise, and Figure 4 shows LINQ queries for such an assignment [9]. These queries illustrate various features of LINQ including existential (Any) and universal (All) quantifiers, join, grouping, returning a single element (Single), and Contains.

The validation of the enterprise includes the verification that the associations are populated correctly. The Employee validation rules include checking 1:1 and M:1 associations. The leads 1:1 association check uses lazy evaluation to verify that if an employee leads a TechnologyArea then the leader of the TechnologyArea must be that employee. The takesCourses property verification checks that all Takes objects indicating the courses that an employee has taken are linked back to that employee. For a 1:M association, consider that a TrainingCourse is in one TechnologyArea and that a TechnologyArea has many TrainingCourses. To verify that population, check that the TrainingCourse c is in the set of courses associated with its TechnologyArea: c => (from TrainingCourse tc in c.area.courses select tc).Contains(c) To verify a direct M:N association, which does not exist in this EMPLOYEE TRAINING enterprise (the M:N between Employee and TrainingCourse uses Takes as an association class to store the date attribute of the association), consider an association between customers and bank accounts in a fictitious bank enterprise. The following checks that an account a is contained in the collection of accounts for each owner of the account: a => (from Customer c in a.owners select c).All(cust => (from Account acct in cust.accounts select acct).Contains(a))

employee(eID, eLast, eFirst, eTitle, eSalary) technologyArea(aID, aTitle, aURL, aLeadID) trainingCourse(cID, cTitle, cHours, areaID) takes(eID, cID, tYear, tMonth, tDay) Figure 3. Relational Schema for Employee Training LINQ to SQL provides a mechanism to retrieve the SQL equivalent to the LINQ query. For example, the SQL equivalent generated for the employeesWithMinSalary query shown in Figure 4 is given here with minor renaming of aliases and formatting changes to improve readability: SELECT e.eID, e.eLast, e.eFirst, e.eTitle, e.eSalary FROM employee AS e WHERE e.eSalary = (( SELECT min(m.eSalary) FROM employee AS m ))

Once the database instance has been validated, the students can be given query specifications to answer over the OODB. An important aspect of the queries is to require a nested (non-1NF) result so that students can be exposed to non-relational results.

295

XAttribute constructors. Each constructor takes a name as the first argument and the value as the second argument. Students have found LINQ easier to use to return results in XML format than Oracle or SQL Server due to their familiarity with SQL and the new operator in OOPLs.

var dbTrainingCourses = from c in trainingCourse where c.areaID == (from a in technologyArea where a.aTitle == "Database" select a.aID).Single() select new {c.cID, c.cTitle, c.cHours};

Additional assignments can be given to write queries involving nesting of the resulting XML for various types of queries as a basis for a comparison of the XML construction capabilities of queries using LINQ, SQL/XML, and FOR XML. The resulting XML can be used in subsequent assignments to explore LINQ queries over XML data where the from clause iterates over a collection of elements.

var empsWhoTookDatabaseCourses = from e in employee where takes.Any(t => t.eID == e.eID && dbTrainingCourses.Any(db => db.cID == t.cID)) select new {e.eID, e.eLast, e.eFirst, e.eTitle}; var empsWhoDidNotTakeAnyCourses = from e in employee where !takes.Any(t => t.eID == e.eID) select new {e.eID, e.eLast, e.eFirst, e.eTitle};

XML Result First369 Last369 Software Engineer

var empsWhoTookCoursesInMultipleTechnologyAreas= from e in employee join t in takes on e.eID equals t.eID join c in trainingCourse on t.cID equals c.cID group c.areaID by e into g where g.Distinct().Count() > 1 select g.Key;

LINQ to SQL var minEmpSalary = employee.Min(e => e.eSalary);

var employeesWithMinSalary = from e in employee where e.eSalary == employee.Min(m => m.eSalary) select e;

var minSalaryEmployees = new XElement("minSalaryEmployees", new XAttribute("minSalary", minEmpSalary), from e in employee where e.eSalary == minEmpSalary select new XElement("employee", new XElement("name", e.eFirst + " " + e.eLast), new XElement("title", e.eTitle))); Oracle using SQL/XML select xmlelement("minSalaryEmployees", xmlattributes(min(e.eSalary) as "minSalary"), xmlagg(xmlelement("employee", xmlforest(e.eFirst || ' ' || e.eLast as "name", e.eTitle as "title")))) from employee e where e.eSalary = (select min(eSalary) from employee); SQL Server FOR XML clause select (select min(eSalary) from employee) as "@minSalary", (select e.eFirst + ' ' + e.eLast as "name", e.eTitle as "title" from employee e where e.eSalary = (select min(eSalary) from employee) for xml path('employee'), type) for xml path('minSalaryEmployees');

var empsWhoTookAllDBCourses = from e in employee where dbTrainingCourses.All(db => (from t in takes where t.eID == e.eID select t.cID).Contains(db.cID)) select e; Figure 4. LINQ to SQL Queries Students can be asked to compare and contrast their SQL solution to their LINQ solution and then to the equivalent SQL. This provides students with an opportunity to practice necessary skills of reading queries and reflecting on the various solutions. A cooperative group exercise can extend the learning outcomes to include query optimization by discussing the relative performance of various approaches to evaluating the query.

5. LINQ TO XML Learning outcomes for an XML and database course typically include the examination of the features of XML-enabled relational databases and the definition, transformation, and querying of XML data.

Figure 5. XML Results in LINQ, Oracle & SQL Server The LINQ query in Figure 5 illustrates the use of the XElement type in the creation of an XML element. The XElement type also provides methods to load and navigate XML data, which are used in LINQ to XML queries.

Most relational database products support an XML type and the ability to return a query result in XML format. A hands-on exercise for the students would be to compare and contrast this capability for well-known database products, such as Oracle and SQL Server, with the capability provided by LINQ.

Initially, the XML data is loaded into main memory using the Load method: XElement empDB = XElement.Load(@"empTraining.xml"); In this example, the empTraining.xml data is assumed to be in an element-based representation of the employee table where each relational attribute is an element in the XML, which is nested within an enclosing element for each tuple:

Figure 5 shows a desired XML result for a query over relational data that finds employees earning the minimum salary using queries expressed in LINQ, Oracle, and SQL Server. Due to space limitations, the details of the established Oracle and SQL Server approaches cannot be discussed in detail. However, LINQ uses a functional construction approach to construct the elements and attributes, typically as part of the select clause, using XElement and

296

111 Last111 First111 Database Administrator 75111 …

6. DISCUSSION LINQ provides a solution to the ROX impedance mismatch, where fundamentally different data models of relations, objects, and XML are typically used in the different tiers (data, business, presentation) of a three-tier distributed architecture. LINQ is based on a theoretical foundation of functional programming [17] and through this formalism is able to unify programming against the disparate ROX data models. This paper has provided a suite of exercises for integrating LINQ within the database curriculum, as part of the broader impact of a grant in which the LINQ framework is used to explore several research issues within a heterogeneous distributed system. These LINQ exercises have been used in various database courses by the author, although only a brief introduction to LINQ is possible in the first database course due to time constraints. There are more opportunities to explore LINQ in an advanced database class. The specific topics covered in such a course appear to vary widely but may include databases and the Web, object databases, and XML [12] as well as data warehousing and mining [18]. Due to small class sizes, a formal assessment of this LINQ integration is difficult. However, the introduction of LINQ appears promising. Students in the advanced database class appear to learn LINQ quickly, typically in one class session. The comparison exercises of LINQ with the generated SQL equivalent query provide valuable insight into SQL for the students, especially for queries that result in the use of grouping or temporary tables in the underlying SQL. When covering LINQ to XML, the students apply LINQ handily to XML based on their familiarity with SQL and the new operator from OOPLs. Since LINQ’s from-let-whereorderby-select syntax resembles XQuery’s FLWOR expression, students appear to understand XQuery more quickly if they already know LINQ. When covering object databases, the ability to provide hands-on querying with LINQ is essential, since OQL was never implemented in a commercial product. Since LINQ is relevant across all three data models, this wide applicability should provide various opportunities for database educators to introduce LINQ in their classes.

Once the XML data is loaded, the collection of elements for the from clause in the LINQ query can be obtained using the Elements or Descendants methods of the XElement type. These methods provide access to the immediate children or descendants, respectively. For example, a LINQ query can define a named extent employees to retrieve the descendant nodes with the name employee: var employees = empDB.Descendants("employee"); The Element method provides access to a named element of a node, and is necessary when using untyped XML. (If you have typed XML with an associated XSD, LINQ uses dot notation to access the element.) Figure 6 provides a corresponding LINQ query over XML data that finds the employees with the minimum salary as in Figure 5 for LINQ to SQL. In untyped XML, the element values are considered to be text. The syntax, (int) e.Element("eSalary"), casts the value of the eSalary attribute to an integer. Figure 6 also shows the corresponding XQuery. Students can explore the query capabilities of LINQ and XQuery through an assignment with various queries that provide a basis for comparison of the XML query languages. LINQ can also be used as an introduction to querying (and transforming) XML [11].

LINQ to XML var minEmpSalary = (from e in employees select (int) e.Element("eSalary")).Min(); var minSalaryEmployees = new XElement("minSalaryEmployees", new XAttribute("minSalary", minEmpSalary), from e in employees where (int) e.Element("eSalary") == minEmpSalary select new XElement("employee", new XElement("name", e.Element("eFirst").Value + " " + e.Element("eLast").Value), new XElement("title", e.Element("eTitle").Value)));

Another challenge that educators can take on is the integration of LINQ outside of the database curriculum. A programming language course for computer science majors usually exposes students to rule-based and functional programming. This course may use Haskell, LISP, ML or Scheme as the representative functional programming language. One idea is to use LINQ to expose students to functional programming concepts, industry practice, and database technology all at the same time. This goal is compatible with CS Curriculum 2008 [1] that adds a requirement of exposure to different programming paradigms.

XQuery let $minEmpSalary := min(//employee/eSalary) return { for $e in //employee where $e/eSalary = $minEmpSalary return {data($e/eFirst)} {data($e/eLast) } {data($e/eTitle)} }

The impact of LINQ is still in its infancy. There are several visions for LINQ in both industry and research. LINQ is being evaluated by the Object Database Technology Group at OMG for its potential in the new Object Database standard [22]. Also, the latest research directions for databases [3] include declarative programming languages and the report specifically mentions LINQ as one of the languages. There has been much earlier work on the integration of declarative query languages with objectoriented languages, known as deductive object-oriented databases (DOOD) [21]. One such effort led to a product known as Validity [14], which was not widely adopted. However, LINQ is integrated into multiple, popular OOPLs, and is more likely to be successful. Another vision is that LINQ will provide a bridge between database developers and programmers by improving developer

Figure 6. LINQ to XML and XQuery

297

productivity through its declarative paradigm and ease of use for rapid prototyping. However, there are always trade-offs. Although LINQ is declarative, a developer must still be aware of its underlying implementation for performance and security considerations [16]. Typically, LINQ to SQL is used for rapid prototyping and testing the application with a SQL Server database, and LINQ to Entities is used to deploy the application in a production environment that may integrate a variety of databases [13]. Why is LINQ important? LINQ brings the advantages of declarative querying from established database technology to object-oriented programming. The declarative language describes the properties of the information to be retrieved rather than procedurally specifying how to retrieve it. The database system infers the type of the query result from the specification. One may be able to envision an analogy between the importance of LINQ and the importance of databases. Why are databases important? Databases provide a useful tool for efficient, shared access to persistent data for many enterprises, providing a higher-level of abstraction than writing a storage system from scratch using files. Similarly, LINQ provides a higher level of abstraction for querying across the ROX data models. This enables the developer to use LINQ as a tool, unifying the three paradigms that are integrated within the same application or across the enterprise. Instead of integrating the technologies by calling numerous methods over disparate APIs, the LINQ framework provides a declarative language and determines how to execute the query. Just as databases are not always a viable solution due to the associated overhead, the applicability of LINQ as a solution should similarly be considered.

3.

Agrawal, R. et al. 2009. The Claremont Report on Database Research. Commun. ACM. 52, 6, June 2009. pp. 56-65.

4.

Albahari, J. 2010. LINQPad. http://www.linqpad.net. Retrieved 9 Sep 2010.

7.

Cattell, R. et al (ed.). 2000. The Object Data Standard ODMG 3.0. Morgan Kaufmann.

8.

Db4objects by Versant. 2010. http://www.db4o.com/. Retrieved 9 Sep 2010.

9.

Dietrich, S. W. 2001. Understanding Relational Database Query Languages. Prentice Hall.

13. Dot Com Infoway. 2010. LINQ to SQL vs. ADO.NET Entity Framework. http://www.dotcominfoway.com/blog/linq-tosql-vs-ado-net-entity-framework. Retrieved 9 Sep 2010. 14. Friesen, O., Lefebvre, A., and Vieille, L. 1996. VALIDITY: Applications of a DOOD System. In Proceedings of Extending Database Technology. pp. 131-134. 15. Grust, T., Mayr, M., Rittinger, J., and Schreiber, T. 2009. FERRY: Database-supported Program Execution. In Proc of the 35th SIGMOD international Conference on Management of Data. pp. 1063-1066. 16. Marguerie, F., Eichert, S. and Wooley, J. 2008. LINQ in Action. Manning. 2008. 17. Meijer, E. 2007. Confessions of a Used Programming Language Salesman: Getting the Masses Hooked on Haskell. OOPSLA. pp. 677-694. 18. Murray, M. and Guimaraes, M. 2008. Expanding the Database Curriculum. Journal of Computing in Small Colleges. Volume 23, Number 3. pp. 69-75.

8. REFERENCES

Adams, E. S., Granger, M., Goelman, D., and Ricardo, C. 2004. Managing the Introductory Database Course: What goes in and What comes out? Proc. SIGCSE Technical Symposium on Computer Science Education. pp. 497-498.

Calvert, C. and Kulkarni, D. 2009. Essential LINQ. AddisonWesley Professional.

12. Dietrich, S. W., Urban, S. D. and Haag, S. 2008. Developing Advanced Courses for Undergraduates: A Case Study in Databases. IEEE Transactions on Education. Volume 51, Issue 1. pp. 138-144.

This material is based upon work supported by the NSF under Grant No. CSR-0915325.

2.

6.

11. Dietrich, S. W. and Chaudhari, M. 2010. The LINQ between XML and Databases: A Gentle Introduction. Journal of Computing in Small Colleges. Volume 25, Number 4. pp. 158-164.

7. ACKNOWLEDGMENTS

ACM/IEEE-CS Interim Review Task Force. 2008. Computing Science Curriculum 2008: An Interim Revision of CS 2001. ACM and the IEEE Press.

Anonymous. 2008. The Standard LINQ Operators. http://www.odetocode.com/Articles/739.aspx. Retrieved 9 Sep 2010.

10. Dietrich, S. W. and Chaudhari, M. 2009. The Missing LINQ between Databases and Object-Oriented Programming: LINQ as an Object Query Language for a Database Course. Journal of Computing in Small Colleges. Volume 24, Number 4. pp. 282-288.

The experience with using LINQ within a database curriculum has been a positive one, supporting the learning outcomes presented for each exercise. The use of LINQ may also support program outcomes by exposing students to functional programming. The use of the free, lightweight LINQPad IDE provides a straightforward formative environment for students to experiment with LINQ. Graduating students are receiving employment in industry positions that utilize LINQ. LINQ is also being explored in database research [15]. LINQ’s acceptance by both industry and research strongly motivates its inclusion in the database curriculum.

1.

5.

19. Novell. 2010. Mono. http://www.mono-project.com/, Retrieved 9 Sep 2010. 20. Oracle Sun Developer Network. 2007. Java Persistence API. http://java.sun.com/developer/technicalArticles/J2SE/Deskto p/persistenceapi/. Retrieved 9 Sep 2010. 21. Sampaio, P. R. F. and Paton, N. M. 1997. Deductive Objectoriented Database Systems: A Survey. Proc. of Rules in Database Systems. pp. 1-19. 22. Zicari, R. ed. 2008. Object Database Systems: Quo vadis? http://www.odbms.org/blog/2008/05/object-databasesystems-quo-vadis/. Retrieved 9 Sep 2010.

298