Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,624
|
Comments: 51,249
Privacy Policy · Terms
filter by tags archive
time to read 1 min | 93 words

So I can eat it (No Scott, I will not go to that resturant again, I know they can probably serve both, but the salad scares me). Appernatly CodePlex is adding Subversion support. What I would really like to know if it would have the same integration that the TFS backend would have as well.

At any rate, I would like to take this opportunity to apologize to the CodePlex team, I would have never believed that you would do it, way to go!

time to read 5 min | 812 words

I have several ways of categorizing code. Production quality, test, demo, and utilities. When I am talking about utilities, I am talking about little programs that I use to do all sorts of small tasks. There I rarely worry about maintainability, and today there was a gem here:

public delegate Control BuildSpecialCase(TextBox textbox);

private BuildSpecialCase GetSpecialCaseControl(string name)
{
 if (name.IndexOf("ConnectionString", StringComparison.InvariantCultureIgnoreCase) != -1)
 {
  return delegate(TextBox t)
  {
   Button change = new Button();
   change.Click += delegate { t.Text = PromptForConnectionString(t.Text); };
   change.Dock = DockStyle.Right;
   change.Text = "...";
   change.Width = 30;
   return change;
  };
 }
 if (name.IndexOf("File", StringComparison.InvariantCultureIgnoreCase) != -1)
 {
  return delegate(TextBox t)
  {
   Button change = new Button();
   change.Click += delegate
   {
    OpenFileDialog dialog = new OpenFileDialog();
    dialog.Multiselect = false;
    dialog.FileName = t.Text;
    if (dialog.ShowDialog(this) == DialogResult.OK)
    {
     t.Text = dialog.FileName;
    }
   };
   change.Dock = DockStyle.Right;
   change.Text = "...";
   change.Width = 30;
   return change;
  };
 }
 if (name.IndexOf("Folder", StringComparison.InvariantCultureIgnoreCase) != -1 ||
  name.IndexOf("Dir", StringComparison.InvariantCultureIgnoreCase) != -1)
 {
  return delegate(TextBox t)
  {
   Button change = new Button();
   change.Click += delegate
   {
    FolderBrowserDialog dialog = new FolderBrowserDialog();
    dialog.SelectedPath = t.Text;
    if (dialog.ShowDialog(this) == DialogResult.OK)
    {
     t.Text = dialog.SelectedPath;
    }
   };
   change.Dock = DockStyle.Right;
   change.Text = "...";
   change.Width = 30;
   return change;
  };
 }
 return null;
}

Can you figure out what is going on?

As long as we are talking about unmaintainable code, here an example from code meant for production that I just wrote:

IDictionary<Customer, IDictionary<string, IList<Policy>>> namedPoliciesByCustomers = new ...;

But for that I have tests :-)

time to read 2 min | 363 words

Scott Hanselman has a post titled: Is Microsoft losing the Alpha Geeks?

The collective group in the discussion at RailsConf seemed to agree that Microsoft should make not just the DLR source available, but actually create a non-profit organization, ala Mozilla, and transfer the developers over to that company. They should allow commits to the code from the outside, which should help get around some of the vagaries of the GPL/LGPL licensed Ruby Test Suites. "IronRuby" should be collectively owned by the community.

In general, I would think that such an organization would be a Good Thing, but it is completely irrelevant to bring the OSS issue into the discussion.

The reason that the "Alpha Geeks" are moving (moved?) from the Microsoft's stuff is very simple. Microsoft's stuff doesn't scale. It doesn't scale for development, it doesn't scale for ease of use, it doesn't scale for elegance.

Microsoft is very focused on the creation of software, but much less focused on working with software. This means that a lot of the issues that arise from working with a large code base over a long period of time have no answer from Microsoft except starting anew. Putting stuff out as OSS wouldn't change that as long as this is the overruling mindset at Microsoft.

Most of the OSS project has a very different mindset than that, but Microsoft is basically just making the source repository public, not OSSing projects. (To be rather exact, they don't work on OSS with the same mindset that other OSS project has, which is highly constrained resources).

I think that part of the problem is that MS is listening to Big customers, which may want what they are supplying, lot of wizards == cheap programmers. By doing so, they are losing the entire Long Tail, and almost by definition, the Alpha Geeks are at the head of the long tail.

time to read 1 min | 144 words

This seems like an obvious way, but it is worth mentioning. I was reviewing the search phrases people use to get to my site, and I found some... extremely explicit ones. Not what you would expect on this site. Repeating the search in google brought me a to a post that had several spam comments of the more nasty side. That gave me the idea of trying:

site:ayende.com explicit-word-or-phrase

I found a lot of those, sadly, and I was able to remove ~50 or so spam comments fairly easily. The main issue with spam is separating the chaff from grain, google made it very easy to find the bad stuff.

time to read 6 min | 1061 words

A while ago I added Mutli Query to NHibernate, but I didn't have the time to add Multi Criteria capabilties in time for the 1.2 release. As it turn out, I managed to implement it about three weeks ago, and only now I had enough time to sit and document it.

Just as a reminder, the end goal is being able to use NHibernate to send this query in a single roundtrip to the database:

SELECT TOP 15 * FROM Customers;  SELECT COUNT(*) FROM Customers;

That is the canonical example for this feature. I think that it falls into the "optimization tricks" category, but I have run into several cases where the functionality was critical to satisfying the time constraints.

At any rate, now we can use this functionality with Criteria as well:

IList multiResults = s.CreateMultiCriteria()

     .Add(s.CreateCriteria(typeof(Customer)).SetMaxResults(15))

     .Add(s.CreateCriteria(typeof(Customer)).SetProjection(Projections.RowCount()))

     .List();

IList customers = (IList)results[0];

IList counts = (IList)results[1];

int count = (int)counts[0];

This result in a single query being send to the DB, and multiply result sets returned to NHibernate.

A more complex scenario may be a page where you have to get several types of data:

  • Policy Types
  • Insurance Types
  • Paged Customers List
  • User personalizaztion info

Now, instead of hitting the database four times, you can package this into a single query, with four results sets being returned.

Caching is supported, but only for the entire mutli criteria query, so you can't cache just the policy types and hit the DB for everything else.

Have fun, and remember the rules of optimization:

  • Don't do it
  • For experts only: Don't do it, yet.
time to read 1 min | 92 words

No, I don't intend to beat him up, I just really like the title :-)

After infecting me (and pretty much everyone else) with witty songs about development, Roy has released one of his songs: Time for Violence.

It is my favorite song of the three or four that he had performed at DevTeach, and I keep humming to myself. Probably because it reflect so well the way that I think about "some databases" that I won't mention by name.

time to read 6 min | 1196 words

Chris Holmes responded to my post about not liking the P&P stuff. Specifically, he takes offence at my dismissal of CAB:

It’s possible that Ayende thinks it’s just a bloated IoC container not worthy to lick Castle’s boots.

I wouldn't phrase it like that, even if I would have agreed to this statement. I think that ObjectBuilder has a long way to go before it has feature parity with Castle Windsor, but that is different than "bloated... ... not worthy of licking my boots... ". Let us not dramatise this issue needlessly.

Now to the rest of the post. I am an ornery bastard, so I am going to go over a lot of the stuff that Chris mentioned that I think deserves a response. That is not everything by a long shot, but I am catching on my RSS/Email after 21 hours of travel, so I got my excuses.

Yes, we could sit down and write our own framework and it undoubtedly would be more lightweight than the CAB because it would serve just our purposes and not attempt to solve anyone else’s problems. But that takes time.

Not really, you implement what you need, and that is much less of what the CAB is trying to do. You would also build it while using it, which tend to give you much more real-world design, with all the rough spots removed or hidden.

Would it be acceptable for them to build Enterprise Library using Castle Windsor?

From a corporate culture alone, I would say that they can't do that. While the choice of tools would certainly affect the way the end result would be built, I don't think that it would significantly change the final product.

The fact that P&P has built their own tools, like ObjectBuilder and the Policy Injection Block, seems like an unfair reason to condemn the whole Enterprise Library. Like saying, “one aspect of this thing sucks, so the whole thing is useless to me.”

Actually, when the building blocks are not stable, there isn't much hope for the building. But that is just to debacle the statement, not to trash talk everything else.

Of course, that’s pretty Ayend’s modus operandi. If something is of no value to him personally, it must suck.

That is news to me, and frankly I find it offensive. I will say that something sucks if trying to use it will cause pain, not if it doesn't bring me any value.

When I read Ayende say that the P&P’s tools are “extremely complex” and “hard to use” I almost can’t believe it. Ayende is a smart guy. So how come he can’t grok Enterprise Library and the simplicity of the tools?

Thanks :-). What am I talking about when I am talking about complexing and hard to use is relative to the problem at hand. I want the simplest solution possible, because trying to solve business problems with pesky clients, hard time limits and changing requirements is hard enough. Simplicity is a goal we should all strive for. That is not to say that you should choose a solution that is too simple, because that would hinder your ability to handle the business scenario.

Here is a good metric that I like to use. Take an technology, and try to build it without any tool assistance. Is it still a good approach? If not, then there it is complex and hard to use. A lot of UI frameworks fails this test, by the way. WinForms certainly does, when you start to think about complex UI.

Ayende’s suggestion is often: cobble together your own solution.

Code word of the day: cobble. I had it thrown at me in the TFS vs. OSS stack as well. I am not a native english speaker, but I do believe that this carries with it negative conotations. My response to this: Mu.

How many developers need a framework like CAB?

Very few, actually. Better to ask, how many developers need a framework to help use MVC in WinForms, and the number would be very high (at least among the developers that know what MVC is). Frankly, I am not sure that an MVC framework is even needed in WinForms. You can probably get away with declerative event wiring alone, and even that I would keep to the more complex applications. MVC architecture I would start by default for everything but the smallest stuff, but MVC framework is not something that I would just start building.

I guess, more than anything, I’m just jealous of Ayende. I wish I were as smart and fast as he is. Because I know it would take me a lot longer than half a day to build a framework like CAB that had all of the features that CAB has.

You have nothing to be jealous about. I will let you in on my secret.

How to build the CAB in half a day: Don't build the CAB.

My main objection to the CAB is that it is too big and invasive. I wouldn't even try to do the same. My approach for this would be a lot simpler, a lot less powerful, and be easier to get starting with. I would grow it with need, so it is shaped by actual business need, not by BDUF though process.

time to read 1 min | 163 words

I just tried to visit this URL: http://pauloquicoli.spaces.live.com/Blog/ in FireFox, I get this message:

Sorry, we are unable to complete your task at this time. The Windows Live Spaces service is experiencing difficulties. Please try your task again later.

In IE, it works as expected. WTF?!

Update:

Looks like this was the issue, I had this cookie
Name: sc_stgclstbl_107
Value:
YjdmOTYxYjQyMjYyNWJkZjE6Rzk2bmRvVzA3WlF6UldO
YlZiNWpnZC9uSkZ2SzVhWHRkSW9iK2RR
T3E4R2lTbUM4cytUSGdKUFZNaVJpY2tkSTYrZC9takRvc09RPQ

The value is not valid base64, appernatly, which is what caused the issue.
time to read 1 min | 181 words

I burst out laughing when I read this:

I don’t know where Ayende works or what sort of environment he works in, but I know he gets a lot of time to blog and maintain his own open source mock framework. Not everyone has that luxery. We have to get real work done under time constraints. We have customers who expect results yesterday. We’re in the trenches trying to implement features for customers who have unrealistic expectations about when things should get done.

Just to point out, I don't "get" a lot of time to blog and maintain my OSS efforts. I put the time for those from my own time, not my employer's time. I do it because it is a hobby and I like it. Time constraints, pissy customers and unrealistic expectations are the reason for a lot of the things that I do.

FUTURE POSTS

  1. PropertySphere bot: understanding images - 3 days from now

There are posts all the way to Dec 26, 2025

RECENT SERIES

  1. Recording (20):
    05 Dec 2025 - Build AI that understands your business
  2. Webinar (8):
    16 Sep 2025 - Building AI Agents in RavenDB
  3. RavenDB 7.1 (7):
    11 Jul 2025 - The Gen AI release
  4. Production postmorterm (2):
    11 Jun 2025 - The rookie server's untimely promotion
  5. RavenDB News (2):
    02 May 2025 - May 2025
View all series

Syndication

Main feed ... ...
Comments feed   ... ...
}