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,565
|
Comments: 51,184
Privacy Policy · Terms
filter by tags archive
time to read 3 min | 546 words

I am giving up on SQLite as my embedded DB of choice. The reason for this is very simple. I really want to be able to use the in memory features (and other nice stuff it has to offer), but it has the worst support for date/time manipulations that I have seen. I am trying to formulate a query that should be along the lines of:

select  *

from    blogs,

        posts

where   posts.blogId = blogs.id

        and ( posts.date + blogs.maxDaysInFeed ) <= getdate() ;

As much as I dislike dates, I tend to work with them in complex ways quite a bit, and I really need a database that can work with me in this regard. I just finished moving my in memory infrastructure to using SQL Server Compact Edition. This means that my tests will have to touch the disk, but I am willing to make this compromise.

In favor of Sql CE are the following:

  • Embedded DB, so it is faster (nor RPC call)
  • It has a behavior that is very similar to SQL Server, so I can test on Sql CE and then move to use SQL Server with worrying about the differences.
  • I can use Management Studio to query it! Killer feature to say the least.

 

time to read 1 min | 198 words

Mike Schinkel has a couple of posts about Microsoft development division that makes for an interesting read:

Be sure to check the comments, Eric Lippert has responded with some very interesting insight. And there is some very interesting discussion beyond that.

My own comment to that is that OSS projects has far less cost of change than most commercial projects. They are structured to enable change (otherwise they die), most commerical projects require a lot of extra baggage to move. If we will take NHibernate vs. the ADO.Net Entity Framework, I can make a change in NHibernate and not consider the affect it will be on the UI that Visual Studio needs to present to the user. Just this can make a world of difference in my ability to add features or fix bugs.

 

Castle Igloo

time to read 22 min | 4219 words

Castle Igloo (ppt) is a very interesting experiment in bringing more MVC goodness into the WebForms. I have to say that when I dove into the code, the ideas that Gilles Bayon (no blog :-( ) had there blew my mind away. I always believed that trying to do MVC in ASP.Net was possible, but fairly awkward.

My main issue with this was always that I always had to do extra work in both the view and the controller in order to make this work, and I never felt that I really got the flexibility that I can get in MonoRail. Here is an implementation of MVP from Phil Haack, as an example. The problem here is that I still have the following problems:

  • I need to define an interface for the view, which will likely contains a lot of data passing parameters.
  • My controller is dependant of that interface, if I want to test that, I need to mock/fake the interface before I can use it, not a big deal, but not as trivial as just dowing new MyController() in the test.
  • My view implementation is dependant on the controller, and is actually responsible for creating it.

I may be spoiled by the pure MVC that I can get in MonoRail, but I really want that back. As I said, I didn't believe that I could get nearly the same experiance, but Gilles has proven me wrong. [Forehead still hurting from that smack]. You can get the code here, I suggest taking a look and seeing what is in there.

Here is a small part of the controller:

public class PatientController : BaseController

{

 

    [Inject(Name = "doctor")]

    public Doctor Doctor

    {

        set { _doctor = value; }

    }

 

    [Inject]

    public IList<Patient> Patients

    {

        set { _patients = value; }

    }

}

And another small part of the view the view:

public partial class Index : Page

{

    [Inject]

    public IList<Patient> Patients

    {

        set { _patients = value; }

    }

}

Notice that the controller doesn't care about the view at all. How does it works? Well, there is some magic behind the scenes, but basically, the controller can register an object in a registry, and when it is done, that object is populated to the view transperantly. Here is the method on the controller that gets the list of patients.

public virtual IList<Patient> RetrievePatients()

{

    IList<Patient> patients = _patientService.RetrievePatients(Doctor);

 

    Scope["Patients"] = patients;

 

    return patients;

}

The view can either call this directly, or rely on getting the value from the scope:

protected void Page_Load(object sender, EventArgs e)

{

     if (!IsPostBack)

     {

            GridViewBlog.DataSource = PatientController.RetrievePatients();

            GridViewBlog.DataBind();

     }

     else

     {

            GridViewBlog.DataSource = Patients;

            GridViewBlog.DataBind();

     }

}

In the second case, we got the value from the scope automatically.

What we gained:

  • No need to define an interface for the view.
  • Controller completely seperated from the view, easier testability.
  • The view is still tied to the controller (since it needs to let it know about things such as button clicks, etc), but trying to avoid that is something that isn't really possible with WebForms (but you are welcome to prove me wrong).
  • Strongly typed support for passing items from controller to view :-)

I fear that I am not really doing much justice to Igloo, mainly because I am still in the process of grokking it. There are still several things there that I need to figure out. There is an automatic navigation part that I am doubtful about (I don't see the usecase, actually). I think that I will try and get a small sample with just the bijection support (the automatic injection and outjection of properties from both controller and view), just to see how I can make this work.

FeedDemon? +1

time to read 2 min | 250 words

I am moving from RssBandit, mainly because the new UI really annoys me now. It doesn't respond properly to scrolling, and other minor annoyances. The big thing is that it has start to consume way more CPU than it should.

I installed Omea Reader for a while, and while I really like it, I keep getting the same old items in many feeds. I am not quite sure why. I also have problems with defining newspaper view vs. normal view, and it rememberring a post that I read three days ago and keep returning to that in a feed that is constantly refreshing. To summarize, Omea Reader doesn't work the way I expect it to, I find it to be very polished, but I am pretty set in the way that I read RSS, and I couldn't figure out how to configure it the way I wanted.

I am testing FeedDemon at the moment, and after a few hours where I had the same feeling of "but I don't want it to work like this", I am starting to get used to it. Just the usage stats alone are looking like a killer feature for me. Why am I posting this?

FeedDemon just made me smile, and that means that it is 99% a keeper. It made me smile by doing what I expected it to do, and doing it in a nice way. I like it.

From the IM logs

time to read 1 min | 149 words

After the fact, I think it is funny:

Ayende Rahien says:

 Real development for me means that I can use .Net
Ayende Rahien says:
 
And that means that I got to have R#,
Ayende Rahien says:
 
that means that I got to have VS.Net
Ayende Rahien says:
 
:-(

JetBrains, can we please get an IDE from you?

time to read 3 min | 431 words

Well, roughly 6Gb. That is the download that I had to go through to get Orcas. And I am not even that interested in Orcas itself at the moment. I just want to test a crazy idea that I had.

At any rate, I got the answer that I was looking for. The code below is not legal:

public class Foo
{
    [IsValid( x => x==null )]
    public string Name;
}
public class IsValidAttribute : Attribute
{
    public IsValidAttribute(Expression<StringPredicate> expr)
    {
    }
}

The errors are:

Error 1 The best overloaded method match for 'ConsoleApplication1.IsValidAttribute.IsValidAttribute(System.Linq.Expressions.Expression<ConsoleApplication1.StringPredicate>)' has some invalid arguments C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 19 10 ConsoleApplication1

Error 2 Argument '1': cannot convert from 'lambda expression' to 'System.Linq.Expressions.Expression<ConsoleApplication1.StringPredicate>' C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 19 19 ConsoleApplication1

:-( :-( :-( :-( :-( :-( :-( :-(

I was really hopeful this time, there isn't any technical reason why this can't be done. The compiler is going to turn the lambda expression into Expression<T> anyway, so it is certainly should be possible to take that and put it in the attribute declaration, thus satisfying the requirement that the values will always be constants.

This is actually harder than it seems, because it probably requires a change in the attributes spec, but I think that this is worth it.

At any rate, I opened up a suggestion at Connect, so please go and vote for it.

time to read 1 min | 151 words

I need to show an iterative apporach to a problem. How I move from a coupled design to a highly de-coupled design. I run into a problem when trying to show that. At the moment, all the tools that I have to visualize a system assume a static state. It is very difficult to try and explain a change in the system, because you have no way of doing this in a clean fashion. What I ended up doing was to create two diagrams of the systems and animate them, but that takes a lot of time and a lot of explaining when it goes on.

What I really would like to see is a way to show a diagram of a change in the system. This can be a refactoring, moving from one architecture to another, versioning, etc.

 

time to read 1 min | 178 words

I am going to give several talks in DevTeach on May. The topics are:

  • Interaction based testing With Rhino Mocks
  • Rapid (maintainable) web development with MonoRail
  • Advanced usages of Inversion of Control containers

I am very excited about it.

The part that I really like is the "Advanced usages..." part of the last name. It means that I can assumes that you know what IoC is and I can blow their minds with the interesting stuff (Binsor, Auto Transaction, Bijection, AoP, Generic Specializing Decorators, Scoped Containers, etc). I am now working on a lecture about IoC for developers that doesn't neccesarily knows what it is, and I am frustrated that I can't get to the really cool stuff.

time to read 1 min | 198 words

I was working on the talk I am going to give in the Microsoft Academy next week, and I really needed to practice saying everything. I quickly gathered some family memebers and subjected them to a high level lecture of IoC. Interesting what you can learn from the amount of glazing in their eyes. :-)

I did the same to some co-workers today, and got even more good feedback (the best piece of advice was from our QA guy, which is certainly not the target audiance). I am starting to get a good feeling about this lecture, even though it is going to be very different from the one I did about Active Record.

That one was basically all code, with a presentation there just to keep me from shooting off in some obscure directions and getting all excited that [HasManyAndBelongToMany] can now do a better job inferring what I mean. This is a more of an overview of the pattern and what advantages it can give me (I have to assume that a significant part of the audiance will be facing this concepts for the first time).

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. Production Postmortem (52):
    07 Apr 2025 - The race condition in the interlock
  2. RavenDB (13):
    02 Apr 2025 - .NET Aspire integration
  3. RavenDB 7.1 (6):
    18 Mar 2025 - One IO Ring to rule them all
  4. RavenDB 7.0 Released (4):
    07 Mar 2025 - Moving to NLog
  5. Challenge (77):
    03 Feb 2025 - Giving file system developer ulcer
View all series

RECENT COMMENTS

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats
}