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

First, we have the implementation of the SendPropertyChanged method, can you spot the bug?

protected virtual void SendPropertyChanged(String propertyName)
{
	if ((this.PropertyChanged != null))
	{
		this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
	}
}

Then, you have:

public string CustomerID
{
	get
	{
		return this._CustomerID;
	}
	set
	{
		if ((this._CustomerID != value))
		{
			this.OnCustomerIDChanging(value);
			this.SendPropertyChanging();
			this._CustomerID = value;
			this.SendPropertyChanged("CustomerID");
			this.OnCustomerIDChanged();
		}
	}
}

And this:

public Customer Customer
{
	get
	{
		return this._Customer.Entity;
	}
	set
	{
		Customer previousValue = this._Customer.Entity;
		if (((previousValue != value) 
					|| (this._Customer.HasLoadedOrAssignedValue == false)))
		{
			this.SendPropertyChanging();
			if ((previousValue != null))
			{
				this._Customer.Entity = null;
				previousValue.Orders.Remove(this);
			}
			this._Customer.Entity = value;
			if ((value != null))
			{
				value.Orders.Add(this);
				this._CustomerID = value.CustomerID;
			}
			else
			{
				this._CustomerID = default(string);
			}
			this.SendPropertyChanged("Customer");
		}
	}
}

Both properties show exactly why I despise code generation as an architectural approach.

Instead of taking the appropriate route, and actually solving the problem at hand, they just threw code at it until it looked like it worked.

time to read 3 min | 450 words

After I got some input from Scott Allen about my Rule Engine post, I took a look at PolicyActivity.

Take a look at the image, my commentary is below it:

image

Can someone please explain me who thought about this idea? When you get something like that, how are you supposed to actually look at this and figure out what is going on? You have no way to look at it and get an idea about what is going on in there. You have to go and look at those sub rules one by one.

For that matter, take a look at the text boxes here. You want me to write code there? There is actually intellisense on those text boxes, which scares me to no end.

How am I supposed to be able to get an idea on what is going on here? An overall view, not just inspecting a single leaf of grass at a time.

How am I to do code review on that? For that matter, how am I going to use source control with that. The answer, sadly, is again, binary source control. No diffs for you, nasty spoiled code driven developer. Take a look at this snippet.

<Rule.Condition>
	<RuleExpressionCondition Name="{p3:Null}">
		<RuleExpressionCondition.Expression>
			<ns0:CodeBinaryOperatorExpression Operator="ValueEquality">
				<ns0:CodeBinaryOperatorExpression.Left>
					<ns0:CodePrimitiveExpression>
						<ns0:CodePrimitiveExpression.Value>
							<ns1:Int32 >1</ns1:Int32>
						</ns0:CodePrimitiveExpression.Value>
					</ns0:CodePrimitiveExpression>
				</ns0:CodeBinaryOperatorExpression.Left>
				<ns0:CodeBinaryOperatorExpression.Right>
					<ns0:CodePrimitiveExpression>
						<ns0:CodePrimitiveExpression.Value>
							<ns1:Int32>2</ns1:Int32>
						</ns0:CodePrimitiveExpression.Value>
					</ns0:CodePrimitiveExpression>
				</ns0:CodeBinaryOperatorExpression.Right>
			</ns0:CodeBinaryOperatorExpression>
		</RuleExpressionCondition.Expression>
	</RuleExpressionCondition>
</Rule.Condition>

I actually had to cut some name space definitions from there, just to make it fit the screen.

Now, please guess what this translate to. Imagine a slightly more complex rule, and then try to do a diff on the changes when someone modify it.

I am waiting to be educated how this is a good thing.

time to read 1 min | 192 words

Just spiked a test implementation on an Event Broker (similar to the CAB), basically support for loosely coupled events / commands. Took about... 40 minutes :-)

My understanding of the functionality in the CAB is based around:

  • [EventPublication], [EventSubscription]
  • [CommandHandler]

As far as I can see the separation between the two is main artifical, and based on whatever this is your code or a third party. Since both rely on events as the underlying mechanism, I don't see a reason to separate them out.

Biggest issue: string equality is a bummer.

I might do a live coding screen cast, showing how it can be done. Tried it now, but it is 2:28 AM right now, and I sound like a drunk sailor. I got tired of apologizing of slipping to Hebrew, and cut the recording.

That 40 minutes mark is starting to freak me, to tell you the truth...

time to read 2 min | 245 words

Can someone please make sense of the following statement? (Found here, on the LINQ Chat log):

Q:What is the key difference between ADO.NET Entities and LINQ 2 SQL?
A: LINQ to SQL is an ORM over your relational database schema plus some mappings. LINQ to Entities is an ORM over a conceptual object-less model (ERM) that is a mapping over your relational database schema.

And:

Q: Is there still an effort to integrate LINQ to SQL and LINQ to Entities?
A: There is an effort on going to align these products, but not to integrate them together.

Can someone please explain me the business sense behind the decision to push two (and let us not forget Linq For DataSet, which I haven't heard about lately) competing frameworks that does the same thing? Can anyone come up with a good explanation for the use cases where I would want to use one and where I would want to use the other?

This has a positioning conflict written all over it.

time to read 2 min | 205 words

Take a look at this:

One of the coolest new capabilities we're building for Enterprise Library v3 is the Application Block Software Factory. As its name ever-so-subtly suggests, this will be a software factory for building your own application blocks.

For some unknown reason, I was strongly reminded of this:

When we stepped back and looked at the global tool infrastructure, we determined that people were frustrated with having to manage and operate a hammer factory factory, as well as the hammer factory that it produced. That kind of overhead can get pretty cumbersome when you deal with the likely scenario of also operating a tape measure factory factory, a saw factory factory, and a level factory factory, not to mention a lumber manufacturing conglomerate holding company.

And that is all I am going to say about it today.

time to read 1 min | 94 words

So, I have trouble with my adsense account, I am doing the right thing by hitting the support pages and actually reading them, but they aren't helping my issue. Therefor, I decide to contact Google's support. I use their own support page, and send an email.

(Image from clipboard).png

I was surprised to get a response almost immediately, the problem is that I wasn't pleased with their message...

(Image from clipboard).png

WTF?!?!?!

time to read 2 min | 214 words

So, I had a bug today in my application. It wasn't configured correctly and it triggered a fault in another system that caused that system to start outputing invalid results about once a second. The invalid results triggered a rejecting reaction in my application, which was considered invalid by the second application, and so on.

So, after I fix the bug, I tell the person responsible that they should take an action to reject the invalid action on my system should it happen again. The action is marked "invalid", and it is something that will only go his way because something very wrong happened (but it must happen, since otherwise the app will swallow the error and no one will know about it).

His response is: "That is not an applicative concern. If you application would work right, there is nothing to worry about."
Me: "We took down production for two days because we couldn't find what the issue was because there were too many issues."
Him: "I don't want to taint my application with stuff that is not a business concern."

I am all for focusing on the domain, but that is pushing it.

FUTURE POSTS

  1. Partial writes, IO_Uring and safety - about one day from now
  2. Configuration values & Escape hatches - 5 days from now
  3. What happens when a sparse file allocation fails? - 7 days from now
  4. NTFS has an emergency stash of disk space - 9 days from now
  5. Challenge: Giving file system developer ulcer - 12 days from now

And 4 more posts are pending...

There are posts all the way to Feb 17, 2025

RECENT SERIES

  1. Challenge (77):
    20 Jan 2025 - What does this code do?
  2. Answer (13):
    22 Jan 2025 - What does this code do?
  3. Production post-mortem (2):
    17 Jan 2025 - Inspecting ourselves to death
  4. Performance discovery (2):
    10 Jan 2025 - IOPS vs. IOPS
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats
}