This is so simple that I don't know why no one has thought about it before, but at the same time, it is so nice.
Check out Roy's ShortWatcher. The tool that will save me so much saying "Alt+F7, Ctrl+B, Ctrl+N"
This is so simple that I don't know why no one has thought about it before, but at the same time, it is so nice.
Check out Roy's ShortWatcher. The tool that will save me so much saying "Alt+F7, Ctrl+B, Ctrl+N"
Given this:
1: SecureFindAll(2: "Order.View",
3: Where.Order.Customer.User == CurrentUser,4: delegate(Order order) { return order.Customer}
5: );Juxtapose the usage and the reasoning.
Hint: Customer is an aggregate in DDD terms.
I am on a new computer, which I hate (the new, not the computer :-) ). I am trying to do the usual things, and I keep enoucnterring all sorts of of ads in places that I have never seen before. I guess that explains why some sites has mysterious blank areas sometimes.
Time to install AdBlock Updater and AdBlock Plus - To get my web back.
Glenn Block has a post that does a lot to explain why the CAB is complex.
I just wanted to share the way I think about complexity, if you need a tool in order to effectively use a piece of software, then you are already in a losing position.
It only took solving something I was dreading of dealing with, with a much easier approach that I believed possible. The problem right now is convincing myself that I don't really want to finish this feature right now. I can't believe how well success can turn a day that was to be rotten.
Anyway, I am off for home now.
I need help preventing the hero syndrome, anyone?
It looks likes I still have a lot to learn about NHibernate, today I took a foray into criteria's projections, which are new and exciting to me, but what excites me right now is this little puppy. It is not that the query is terribly complicated, it is that this is traversing six tables as easily as it can be. From the Multi Query reference, you can probably understand why I am excited, I need to get ~6 results sets for this to work, and it is looking like this is going to be very easy to do it in a performant way.
.png)
You have to realize, I am at the point when I am running passing tests in the debugger, just to check out how cool this is. In the time that it took me to write this post, I have implemented the bare bones of what is most probably the hardest part of the system. This particular functionality requires data from 30(!) tables. The final query is over 5Kb in size, and goes on for 3 pages. (I am talking about the final query, not the one above.)
And to forestall the obvious questions, yes, I use this color scheme sometimes, I amuses me.
I am teaching beginners right now, and we started out from:
using (SqlConnection connection = new SqlConnection(Settings.Default.Database))
{
connection.Open();
using (SqlTransaction tx = connection.BeginTransaction())
{
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "SELECT COUNT(*) FROM Books;";
result = (int)command.ExecuteScalar();
}
tx.Commit();
}
}
But they said that they already know this stuff and I am boring, so we moved to this:
return With.Transaction<int>(delegate(SqlCommand command)
{
command.CommandType = System.Data.CommandType.Text;
command.CommandText = "SELECT COUNT(*) FROM Books;";
return (int)command.ExecuteScalar();
});
Where the implementation is:
public static void Transaction(Proc exec)
{
using (SqlConnection connection = new SqlConnection(Settings.Default.Database))
{
connection.Open();
SqlTransaction tx = connection.BeginTransaction();
try
{
using (SqlCommand command = connection.CreateCommand())
{
command.Transaction = tx;
exec(command);
}
tx.Commit();
}
catch
{
tx.Rollback();
throw;
}
finally
{
tx.Dispose();
}
}
}
}
They didn't think it was boring any longer :-)
That made for some interesting diagrams, just to show the flow of the code. The piece of code above covers a lot of topics, next step is to introduce Unit of Work.
They are beginners, so they need to understand the basics well before they can do anything with frameworks, but I just find it so frustrating to work on the naked CLR. It is like a construction worker that can arrive on a building site with an anvil and a hammer, and then need to build all the tools before they can start working.
Zabasho - (Hebrew: זבש"ו) - can be literally translated to "It is his problem", but is usually meant to also express complete disinterest in the result of an action done by someone else.
Example: "If he will send that email, he is getting fired, I told him that. Zabasho."
Ayende's Example: "The user wants all the screen aqua on pink, he will go blind. Zabasho."
StoryVerse is an agile management web application, based on MonoRail & Active Record. The UI is very googlish in nature, and I really like it. Still very early in the project, but showing a lot of promise.
The way that the guys from LunaVerse are using the criteria objects had me scratching my head for a while, until I saw how it is used on the controller, then I had a "Wow! That is cool!" momemt.
Here is a sample:
You really need to check out the code in order to appriciate it. It is like placing a lot of domino pieces and watching them all fall into places, no extra work required. Here is one technique that I am so going to take advantage of next time I am going to write a search screen.
Just to reference a great article about using NHibernate & WCF, worth checking out.
No future posts left, oh my!