December 24, 2009

LINQ is nice: the same problem solved by different LINQ queries

There is a nice question in our support forum, especially if you started to use LINQ just recently.

I imagined 4 different queries leading to expected result. First 2 of them are almost identical, but others are not. Can you add other queries solving the same problem?

December 22, 2009

Testing new version of Help Server

We've just updated help.x-tensive.com to the upcoming Help Server v3.0.

What's new:
  • New CSS-based skins designed to improve the usability: there are Blue and Black themes with horizontal/vertical header (4 themes total; Black theme with horizontal header is here). Tab bar is now always vertical.
  • Keyboard support: Alt-C (TOC), Alt-I (Index), Alt-S (Search); Up/Down/Left/Right, Tab, Shift-Tab; Enter (open the document). In Firefox Alt = Alt+Shift; in Safari Alt = Shift; in Opera Alt = Shift-Esc, Shift.
  • Zooming (Ctrl-"+", Ctrl-"-" in most of browsers).
  • Opera & Safari support. So currently it works ideally in 5 major browsers: Internet Explorer, Firefox, Chrome, Safari and Opera.
If you'll find any bug there, please describe it in comments to this post.

DataObjects.Net v4.1 is updated to v4.1 RC2 (build 168); status update

I recommend you to switch to this version now for any development code. Doing the same for production code is not recommended - we know there is at least one important issue:
  • Issue 553: Upgrade from v4.0.X to latest v4.1 leads to data lost in Perform mode
Note that this version already contains some code related to O2O mapping, full-text search and localization code from v4.2. These parts are implemented mainly as extensions to an existing API, so we know they don't affect on stable parts (tests show this as well). Please ignore these parts for now - APIs there are absolutely preliminary; they're implemented mainly to evaluate the approaches.

This version includes at least one breaking change affecting on almost any code you wrote:
This means you must use a single Query type now instead of its two "parts". I decided to implement it ASAP before release; Manual already reflects the update.

To quickly change your existing code, you can use Search and Replace in Visual Studio .NET (Ctrl-H) as it is shown here:


This pattern shows how to replace Query<T>.All calls; Query<T>.Single* calls can be replaces by similar fashion.

What's new in this update?
Why v4.1 is delayed for almost a month?

There are set of reasons for this:
  • Manual is still not fully ready. That's completely my fault, I completely underestimated the time I need to review (actually, to rewrite ;) ) it.
  • We must implement few more fixes there to ensure the count of failing tests is minimal possible (i.e. only the tests expected to fail because of absence of some feature are failing). Currently ~ 10 additional tests are failing (cases are pretty complex, so it's unlikely you'll face any of these issues). Total count of tests for Xtensive.Storage is ~ 1300.
  • As you may find, we've implemented a set of pretty complex issues that were extremely necessary for some of DO4 users, including at least nested transactions and support for legacy databases. So if you need something ASAP, feel free to ask, we're doing our best to bring the features you need.
So what DO4 team implements now?

Actually, almost all our developers are already switched to features scheduled for v4.2 (~ January):
  • O2O mapping: Alexander Nickolaev;
  • Localization: Alexis Kochetov, Alex Gamzov, Dmitry Maximov;
  • Full-text search: Alexis Kochetov, Alex Gamzov;
  • Access control system: Dmitry Maximov (not started yet);
  • Everything else + low-level APIs: Denis Krjuchkov.
Btw, as you see, we've scheduled top 4 issues from our feature poll for for v4.2. Most likely 5th one (migration from v3.9) will be implemented as well.

Alex Kofman works on one more WPF sample & DisconnectedState (v4.1.1); I'm working on Manual, various usability related issues and fixes - i.e. the only left TODOs for v4.1.

So I hope the official v4.1 release is quite near now. Sorry for write almost nothing during last weeks - I'm really quite busy with this.

P.S. Few hours ago I celebrated my 30-nth birthday - and I still can't imagine I'm so old (ok, mature ;) ) now. Any advices? Ok, I'm joking, but I still didn't internally decide if I must be glad because of this or not. I suspect most of people reacts this way when their 4th decade starts.

December 17, 2009

Fixing the bugs in DataObjects.Net LINQ translator: an example case

Sometimes we get pretty strange bug reports:

DO

During fixing the issue we frequently check how other ORM tools handle this. Normally we start from LINQ to SQL, since currently it supports more standard LINQ operations in comparison to EF:

L2S

So L2S fails on this case, and I’d say this is an epic fail. I’m curious how this could happen at all – i.e. why it did not translate property name at all, and why it was appended to column name in SELECT list?

Btw, Entity Framework handles this case properly:

EF

So although LINQ itself is pretty simple, LINQ providers are really complex.

P.S. Of course the bug is fixed in DataObjects.Net repository.

December 8, 2009

Boolean branching in DataObjects.Net

I just posted a response to StackOverflow.com explaining yet uncovered feature of DO4. Likely, you don't know this, but this feature exists from ~ mid-Summer.

P.S. Please don't vote for this answer.

December 7, 2009

Localization support: link to Dmitri Maximov's post

Dmitri Maximov has started to write a series of posts about localization in DO4. Here is the first one.

P.S. Writing this since I have almost nothing to write about update so far. Libraries are ready, but works on Manual aren't finished. Thinking about releasing v4.1 with incomplete manual, and fix it with v4.1.1.

December 3, 2009

DataObjects.Net at Google Wave

I just created a Google Wave for DataObjects.Net. So if you have any thoughts related to it, it's a good place to share them.

If you need an invite to Google Wave, please leave us your e-mail here, or send it to my Skype (alexyakunin).

Should we rename DataObjects.Net?

Leave your opinion in comments below. Exact name does not matters - I just want to know if current product name is attractive at all - in particular, in comparison to its competitors.

Related forum thread: http://forum.x-tensive.com/viewtopic.php?f=57&t=5440

What do you need in DataObjects.Net right now?

Please answer on the following question: what do you need in DataObjects.Net right now to use it successfully?

v4.1 is the point where most essential features are implemented, but there are still lots of features with lower importance. So to prioritize them, I'd like to ask you about this. Here are essential features we have in our issue tracker:

General features:
7. Peer-to-peer synchronization (action-based and state-based)

Features related to storage providers:

Please select up to 3 features from both lists (not 6 at max, but 3 at max) - lists are separated just for your convenience.

How to vote:
a) Add a comment with your votes below. E.g. "1,2,3".
b) Or vote in this Google Wave. If you need an invite to Google Wave, please leave us your e-mail here, or send it to my Skype (alexyakunin).

December 2, 2009

Merged DataObjects.Net manual (for now only in HTML)

Today we created a small tool merging all parts of the manual together, so now there is a single file version of manual - this means it must be possible to print it as well. But I don't recommend you to do this right now - few chapters there aren't written yet; moreover, there are no special styles for printing. So it's really better to wait for few days; moreover, shortly we'll build its PDF version ideal for printing.

P.S. If you will decide to print it, do this in Internet Explorer (print with background colors) - by my impression it must do this better than other tested browsers (I tried this in Firefox 3 and Google Chrome).

December 1, 2009

Nice part of Manual: Advanced LINQ

I'm still reviewing the Manual &amp; write its unfinished parts. Today I reviewed "Advanced LINQ" part originally written by Alex Gamzov, and it's ready for being shown now. It contains the following chapters:
  • Customizing LINQ translation
    Explains how to customize compilation to SQL and write custom LINQ expression rewriters.
  • Joins, casts, references, inheritance and subqueries in LINQ
    Explains how particular constructions are translated to SQL.
Both chapters must be really interesting. For example, custom LINQ rewriters allow to implement such methods, as .WhereAllowed(this IQueryable<T> query, Permission permission, Principal principal).