<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ramble &#187; Scott Guthrie</title>
	<atom:link href="http://www.alterzone.net/blog/category/scott-guthrie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alterzone.net/blog</link>
	<description>Where the Future Never Looks the Same Way Twice</description>
	<lastBuildDate>Mon, 17 Jan 2011 02:43:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CodeMash: Developing Data-Driven Web Applications with LINQ</title>
		<link>http://www.alterzone.net/blog/2007/01/19/developing-data-driven-web-applications-with-linq/</link>
		<comments>http://www.alterzone.net/blog/2007/01/19/developing-data-driven-web-applications-with-linq/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 21:08:58 +0000</pubDate>
		<dc:creator>Stephen Tolton</dc:creator>
				<category><![CDATA[CodeMash]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Scott Guthrie]]></category>

		<guid isPermaLink="false">http://www.alterzone.net/blog/2007/01/19/developing-data-driven-web-applications-with-linq/</guid>
		<description><![CDATA[Presented by: Scott Guthrie These are &#8220;live&#8221; notes and necessarily rough. Today&#8217;s Problem: Data != Objects Traditional data access includes a mixture of languages (SQL and native code), arguments loosely bound, results loosely typed, compiler cannot help catch mistakes and queries in quotes within the code. In LINQ, classes describe data. There is encapsulated business [...]]]></description>
			<content:encoded><![CDATA[<p>Presented by: <a title="Scott Guthrie" href="http://www.alterzone.net/blog/weblogs.asp.net/scottgu">Scott Guthrie</a></p>

<p>These are &#8220;live&#8221; notes and necessarily rough.</p>

<p>Today&#8217;s Problem: Data != Objects</p>

<p>Traditional data access includes a mixture of languages (SQL and native code), arguments loosely bound, results loosely typed, compiler cannot help catch mistakes and queries in quotes within the code.</p>

<p>In LINQ, classes describe data.  There is encapsulated business validation.  A query is a natural part of the language and the compiler provides intellisense and type-checking.</p>

<p>LINQ can query against objects, relational, and XML.  Also, LINQ enabled ADO.NET &#8211; LINQ to Datasets, LINQ to SQL, LINQ to Entities.  Plugin architecture, can create new &#8220;LINQ to&#8221; modules.</p>

<p><em>LINQ Basics </em></p>

<p>Query operators can be used against any .NET collection (IEnumerable)</p>

<ul>
    <li>Built-in examples: Select, Where, GroupBy, Join, etc.</li>
    <li>Extensibility model supports adding/replacing them</li>
</ul>

<p>Query Expressions can operate on information sources and apply query operators against them to return IEnumberable sequences.  Chain operators together.</p>

<p><em>Projections</em></p>

<ul>
    <li>Take results from expression and modify it in a different way</li>
    <li>Enables &#8220;data shaping&#8221; in query expressions</li>
</ul>

<p>Projections w/ Anonymous Types makes the compiler create an object with the properties of the type on the right-hand assignment of the first assignment. Still strongly typed at runtime. <em>Very cool.</em></p>

<p><em>LINQ to SQL</em></p>

<ul>
    <li>Maps .NET classes to relational SQL data</li>
    <li>translates LINQ queries to SQL execution</li>
    <li>Supports change tracking for insert, update, delete operations</li>
    <li>supports entity-level validation rules</li>
    <li>built on top of ADO.NET and integrates with connection-pooling and transactions</li>
</ul>

<p>Associations</p>

<ul>
    <li>Usually expressed with PK/FK</li>
    <li>Relationships inferred from FK</li>
</ul>

<p>LINQ can implement server-side paging and complicated joins.</p>

<p>LINQ different from embedded SQL in that it is strongly typed and can also query against different data sources, not just relational databases.</p>

<p>LINQ for SQL Architecture Services:</p>

<ul>
    <li>Change tracking</li>
    <li>Concurrency control</li>
    <li>Object identity</li>
</ul>

<p>db.SubmitChanges() will generate SQL code to update database.  Can drop down and put in your own SQL or stored procedure, but really shouldn&#8217;t do this unless really necessary.</p>

<p>Implicit or explicit transaction scope.</p>

<p><em>BLINQ</em></p>

<ul>
    <li>UI scaffold</li>
    <li>Point to DB and it will create CRUD pages</li>
    <li>Generates LINQ for SQL data model</li>
    <li>Easy way to quickly build CRUD pages against data models</li>
    <li>Free download today</li>
</ul>

<p><em>LINQ for Entities</em></p>

<ul>
    <li>Entity Data Model (EDM) enables rich conceptual modeling of data</li>
    <li>Entities can be split across multiple tables, and support rich inheritance</li>
    <li>Higher level of abstraction</li>
    <li>Full LINQ support over EDM definitions</li>
</ul>

<p><em>LINQ to XML</em></p>

<ul>
    <li>Declarative construction of XML document</li>
    <li>Support for language integrated queries</li>
    <li>Cleaner, simpler, smaller and faster XML API</li>
    <li>Does  XML TextReader for you</li>
</ul>

<p><em>There was lots of stuff in this presentation, so check out the slides, especially for the code samples.</em></p>

<p>Fin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alterzone.net/blog/2007/01/19/developing-data-driven-web-applications-with-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeMash Keynote: Language Integrated Query (LINQ)</title>
		<link>http://www.alterzone.net/blog/2007/01/19/codemash-keynote-language-integrated-query-linq/</link>
		<comments>http://www.alterzone.net/blog/2007/01/19/codemash-keynote-language-integrated-query-linq/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 14:43:58 +0000</pubDate>
		<dc:creator>Stephen Tolton</dc:creator>
				<category><![CDATA[CodeMash]]></category>
		<category><![CDATA[Scott Guthrie]]></category>

		<guid isPermaLink="false">http://www.alterzone.net/blog/2007/01/19/codemash-keynote-language-integrated-query-linq/</guid>
		<description><![CDATA[Presented by: Scott Guthrie These are some &#8220;live&#8221; notes, written during the presentation. They will, necessarily, be a bit rough. Introductions. &#8220;Scott, the father of ASP.NET&#8221; LINQ is a new way to think about data that has ideas applicable to other languages, not just .NET languages. Working with Data Querying and manipulating data is fundamental [...]]]></description>
			<content:encoded><![CDATA[<p>Presented by: Scott Guthrie</p>

<p>These are some &#8220;live&#8221; notes, written during the presentation.  They will, necessarily, be a bit rough.</p>

<p>Introductions.  &#8220;Scott, the father of ASP.NET&#8221;</p>

<p>LINQ is a new way to think about data that has ideas applicable to other languages, not just .NET languages.</p>

<p><em>Working with Data</em></p>

<p>Querying and manipulating data is fundamental part of a programmer&#8217;s job.  Data formats change, but core needs remain the same.</p>

<p>Data access code in 1980s with DBASE has a certain elegance, and while we evolved more powerful language constructs, the APIs in the 1990s/early 2000s are way more complex and far from elegant.  Very procedural and far from the data.</p>

<p>Object/Relational Mapping is big leap forward and provides a cleaner integration of business rules.  But, it has limitations, like how to query data from a variety of sources.  O/R mappers are for relational, but what about web services, XML, RSS, REST, etc.?  There is also a disconnect between data schema and how we represent and transform the data in object form.</p>

<p><em>Introducing LINQ</em></p>

<p>Take the ideas of Query, Set, and Transform Operations and make them first-class citizens of .NET.  Works with Relational, XML, Objects.  Works with all .NET languages (both C# and VB have integrated support).  Works with both static typed and dynamic languages (going into IronPython compiler!).</p>

<p>The language provides a syntax to  create query expression against any kind of data.</p>

<p><em>Demo</em></p>

<p>O/R not a core component, but ships with it as an abstraction on top of LINQ.  Scott creates some models in the VS GUI that link to the relational database tables.  Automatically linked together according to schema.  These are the core O/R that will be used to query against.</p>

<p>Is going to query for product information and price using a simple template.</p>

<p>var query = from p in db.Products</p>

<p>select p;</p>

<p>DataList1.DataSource = query;</p>

<p>DataList1.DataBind();</p>

<p>UI is populated.</p>

<p>Can use native VS debugger to introspect LINQ, so you always know what is going on.  Demos using debugger.  You can look at the raw SQL and the data returned.</p>

<p>Anonymous types allow you to define new type on the fly, to modify the columns returned.  Also showed how to dynamically calculate a new column (i.e. revenue in this case).  Can also compose queries across languages.  <em>Very cool. The raw SQL is pretty long and cumbersome.  Impressive.</em></p>

<p>Shows example of using LINQ with XML file.  Instead of XQuery, using the same LINQ syntax to query the XML.  No iterating over TextReader!</p>

<p>Shows binding against collection of objects.  Uses GetProcesses() to get some info about processes and uses a LINQ query to find those processes that start with the letter &#8220;i&#8221; and have a WorkingSet of a certain size.  <em>Cool.</em></p>

<p>You can also combine data from these various sources and join them together, which creates a new dynamic object on the fly which the control can bind against.</p>

<p>End of demo.</p>

<p><em>Declarative Intent</em></p>

<p>LINQ can be thought of as an internal DSL that makes life simpler for query and transform operations.  Describe <em>what</em> not <em>how</em> you want things done.  The industry is moving in this direction.
Moving towards declarative intent is not just about productivity.  It can help you significantly improve performance and better utilize multi-core processors, for instance.  Currently, we use a very imperative way to do things and the imperative logic flow dictates the algorithm to use.  It&#8217;s very single threaded and won&#8217;t utilize multiple cores.  We need to move to a model that takes advantage of the other cores.  Declarative intent programming can allow programmers to write code that is optimized &#8220;under the covers&#8221; for the multiple core environment, so the developer doesn&#8217;t need to know all about doing the threading for multiple cores.  The query can express <em>what we want </em>instead of <em>how to get it</em>.</p>

<p><em>Summary</em></p>

<ul>
    <li>LINQ makes query first class part of programming platform</li>
    <li>enables queries against objects, relational data, XML, or any custom domain</li>
    <li>Support for al .NET languages</li>
    <li>Built-in to .NET and Visual Studio &#8220;Orcas&#8221; release later this year</li>
</ul>

<p>Fin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alterzone.net/blog/2007/01/19/codemash-keynote-language-integrated-query-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

