October 2007 - Posts

Coming Soon:: DevConnections Las Vegas
23 October 07 09:52 AM | despos | 4 comment(s)

DevConnections Las Vegas is approaching and it looks like there will be quite a bunch of people. We're close to 5,000. Why not joining such a crowd and mark a new record?

Reasons to attend? Be among the first to get VS 2008 in addition to a beta of SQL Server 2008 Katmai and Windows 2008 Server RC1. Plus the "pleasure" of hearing from me <g>. Here's the list of my scheduled talk in this pretty busy but funny week.

APR306: Building AJAX Applications with ASP.NET 3.5 
Monday Nov 5 (9:00AM - 4:00PM)
Full-day workshop
Each AJAX application, regardless of the underlying platform, has a common 2-tier architecture where a front-end and a (multi-tiered) back-end talk by exchanging JSON packets over HTTP. In ASP.NET 3.5, the first version of ASP.NET to incorporate AJAX natively, you have two options for building applications—-partial rendering and script services. Partial rendering doesn’t give you any architectural shift but is quick to apply and learn. If you opt for services, then you need JavaScript and DOM to build up a nice interface for the user. This means, however, a lot of client coding in an interpreted environment and subject to bugs and memory leaks of some browsers. In this workshop, we’ll first carefully review the technical details of partial rendering and script services and then put everything into perspective by going through a series of realistic scenarios and architectural considerations.



ACS201: The New Frontier of the Web User Interface: Silverlight and ASP.NET AJAX

Wednesday Nov 7 (8.00 am-9.15am)
Breakout 
Silverlight, formerly codenamed WPF/E, is the Microsoft solution for delivering animation, graphics, audio, and video over the Web in a cross-platform way. Based on a subset of Windows Presentation Foundation, Silverlight enables the creation of content and applications that run within multiple browsers, currently on both Windows and Macintosh systems. Silverlight requires a lightweight, free, browser plug-in, is programmable using JavaScript, and works very well with ASP.NET AJAX. This talk introduces you to the wonders of Silverlight in the context of ASP.NET AJAX applications.

VDA302: Typed DataSets, Linq-to-SQL, Linq-to-Entities: Data Design Patterns Do Matter
Wednesday Nov 7  (10.00am-11.15am)
Breakout 
Data access code has not changed significantly in the last 15 years. Most of the data access patterns introduced by ODBC in the early 1990s are still the foundation of OLE DB, JDBC, and ADO.NET. The query is expressed as a text string that is opaque to the programming language. Results are returned in untyped data records. Not to mention the intricacies of JOINs and grouping that often require developers to build a totally different skillset. There is a strong need for applications to manipulate data at the conceptual level so that data can be easily transformed into objects that are more natural for the application to work with. In the beginning it was the DataSet, better its typed version, with a little help from wizards in Visual Studio 2005. As weird as it may seem, such an approach is the implementation of a popular design pattern—the Table Data Gateway. LINQ to SQL, instead, is just the transposition of the Active Record design pattern whereas LINQ to Entities goes beyond and hits the most abstract data design pattern—the Data Mapper.What’s behind these patterns? Can you use them together in a data layer? How do you choose the one that best fits your scenario? We may not have the silver bullet, but we do have insights on data access at the time of Visual Studio 2008.

MWM312: Mobility in the Real-World: Designing for High Demand of Live Data in Wireless Applications
Wednesday Nov 7  (11.30am-12.45pm)
Breakout 
Based on a real-world project, this session discusses options faced and architectural choices made in the design and building of a wireless application to interface a live scoring system. From the mobile device, data flows into a remote server to be finally uploaded to the Web server that end users connect to. The coding techniques demonstrated in this session and infrastructure choices presented here made it a successful project. Come learn how it was done and how you can leverage this experience for your own real-world projects.

VAR303: The Model View Presenter Pattern in Real-world Enterprise Systems
Wednesday Nov 7  (2.30pm-3.45pm)
Breakout 
When it comes to building applications, all developers tend to start coding on day 1. One of the most common snags that originate from this approach is that the presentation layer ends up containing much more logic than it should. More importantly, the boundary between presentation and business layers is not clearly set and this leads to reduced extensibility, poor flexibility, complexity--in one word, bad design. Sure, the inherent complexity of the problem domain plays its role. The more complex the scenario to address, the more powerful modeling techniques are required. One of these is the Model View Presenter pattern.

ACS301: Inside ASP.NET Partial Rendering
Wednesday Nov 7  (4.15pm-5.30pm)
Breakout 
Architecturally speaking, one of the most problematic aspects of building AJAX applications is crafting an efficient and effective presentation layer. Clearly, the issue here is not richness of functionality—for which AJAX is inherently the right answer—but how to deal with that richness and still limit traditional viewstate-based postbacks and keep the front-end lean, mean, and especially quick. Partial rendering—one of the possible approaches that ASP.NET AJAX propounds—doesn’t build on a new architecture but leverages all of the existing stuff and just does it better. But how better and what you can do to make it really better? In this session, we’ll dig out the inner mechanism that make partial rendering work, reveal its real tricks and come to discover its strengths as well as its weakness.


VWF303: Hosting and Integrating Workflows in Multi-tier Applications
Thursday Nov 8  (8.00am-9.15am)
Breakout 
Workflows model business processes. Created by composing activities, workflows require a bit of plumbing to be successfully integrated in client applications. In the end, a workflow is an assembly that exposes some classes; so you can call it from within a variety of environments--Windows Forms, WPF, ASP.NET, and even console applications. Direct hosting, though, poses some issues. In particular, it forces client developers to know and work out too many details--runtime, services, schedulers, tracking, persistence--that are not specific to the business process they're reproducing with software. In addition, a workflow is generally a middle-tier component. How would you connect to that from your client? For all these reasons, directly hosting a workflow in a Windows Forms or ASP.NET application is good only for a quick demo, which you won't see in this session. Instead, I'll examine how to build an abstraction layer on top of a workflow and how to deploy this abstraction layer over the tiers of your application. I'll also take a deep look at the tools and infrastructure coming out with Visual Studio "Orcas" and .NET 3.5.

VAR309: Patterns and Practices for Modeling Domain Logic
Thursday Nov 8  (9.30am-10.45am)
Breakout 
Also referred to as business logic, the domain logic represents what the application needs to do for the domain you're working in. Domain logic includes input-based calculation, validation, and dispatch of commands to data sources. Ideally, the domain logic completely hides the data sources and reports to the presentation layer. But this is not necessarily a common practice, because in reality it is often easy to connect presentation and data directly using domain logic only to massage the data before display. How would you organize domain logic? What's the best and most commonly used approach? And what are the alternate solutions? In this presentation, you'll get up close and personal with three primary patterns for modeling business logic: transaction script, domain module, and table module.



APS301: Challenging ASP.NET for Bravehearted Developers  
Friday Nov 9 (9:00AM - 4:00PM)
Full-day workshop
A deep understanding of the internal mechanics of ASP.NET pages may lead you to do virtually anything. Or, at least, anything that is not strictly prohibited by the internal architecture of the run-time environment. In this workshop for bravehearted ASP.NET developers, you'll take up some of these challenges. For example, you'll explore ways to modify Web sites without touching the source. Useful to inject tracking code in a remote site, the technique requires an advanced familiarity with HTTP modules and handlers. You'll also see how to catch undocumented run-time events, dissect protected overridable methods of system controls, and replace declaratively controls in any page of a Web site.

 

Filed under:
On .NET Rocks
10 October 07 11:36 AM | despos | 1 comment(s)

On .NET Rocks next week, Oct 16 to chat with Richard and Carl about AJAX architectures and Silverlight. And why ... Silverlight 1.0 is currently similar to a declarative and programmable platform to build ... smarter animated GIFs.

Filed under:
What am I missing with table adapters?
10 October 07 11:22 AM | despos | 1 comment(s)

An excellent question to reply to tons of literature and zillions of words about architecture, middle-tier, design, DAL, LINQ and so on.

If I use TableAdapters, apart from the pretty ORM diagram in LINQ, what am I missing?
 

The short answer is that functionally speaking, you miss just nothing  :-) If it works for you, that's OK.

A more articulated answer entails one brings on the architectural perspective of things. So architecturally speaking, the pattern behind table adapters is a Table Data Gateway with a vision of the data model that is along the guidelines of the Table Module pattern. In a nutshell, everything is a table; you model your actions through the schema of database tables and you use a gateway object to centralize your data access code--ADO.NET or perhaps Linq-to-SQL stuff.

Where do you start missing something? As the complexity grows beyond a certain threshold. If you never reach that threshould, you're just fine.

There's a nice figure in the Martin Fowler's book "Patterns of Enterprise Application Architecture" that shows how Table Module is a pattern with a relatively low initialization cost. These costs describe a function that runs pretty soon into an asymptote--a sort of vertical wall that it attempts to overcome making costs go high with the complexity of the domain. A domain-based model--like the one that more or less you can see through Linq-to-SQL, has a more linear curve, with higher initialization costs but a regular growth with the complexity of the domain to design and implement. 

 

Filed under:
LINQ Syntax and Linq-to-SQL
04 October 07 12:37 PM | despos | 2 comment(s)

Linq-to-SQL translates standard query operators of LINQ into T-SQL commands for the versions of SQL Server supported by the ADO.NET 3.5 managed provider. Although a lot of understandable similarities with SQL constructs exist in LINQ, it is key to note that LINQ operators are defined against an ordered sequence of elements. The T-SQL language (as well as any other SQL-based language) works instead with unordered sets of values.

Do not confuse this with the ordering you can apply through the ORDER BY clause. The ORDER BY clause is merely an operation that occurs once the sequence has been obtained. What you get in this case is always an unordered set that is then ordered in the way you requested and just for your convenience. The order is not implicit in the sequence.

As a result, the identity of an element descends from its values, not from its position in the sequence. Sounds familiar? Sure, it's one of the pillars of the SQL language.
Because of this substantial difference between in-memory collections and result sets, certain standard LINQ operators do not work properly or are just not supported in Linq-to-SQL.

Want some examples?

For example, Take and Skip originate quite complex T-SQL statements in fierce contrast with their inherent simplicity. Other operators such as TakeWhile, SkipWhile, Last, ElementAt, Reverse are just not translated to T-SQL and are unsupported by Linq-to-SQL.

Filed under:
More Posts