Showing posts with label Truth. Show all posts
Showing posts with label Truth. Show all posts

Wednesday, May 20, 2009

Signs You Need A Hobby, Part 26: Data Access Stimulates You

Here's a manifesto about Microsoft's Entity Framework. I need you to understand something about the tone of this message: there's actually enough people who feel passionately about data access to write a manifesto about Microsoft's Entity Framework, and I frankly find that shocking. You know what? If you care about this so much, go look at a mountain, have sexual intercourse, do some old-school breakdancing, do some tequila shots. Seriously, time to prioritize.

I gotta pick this blog post apart. I realize that, in doing so, I am lowering myself to that level, but if it's any colsolation it's already 3:00 in the afternoon so I'm probably already drunk while I write this.

Let's start with a few choice quotes:
The signatories of this letter are unanimous in expressing concern for the
welfare of software projects undertaken in the Microsoft customer community that
will make use of the forthcoming ADO .NET Entity Framework.

And here's another:
We remain willing to collaborate with Microsoft and the ADO .NET Entity
Framework team to forge a positive action plan to help the Microsoft customer
community achieve success with entity architecture applications.

Now if the first quote was written like this:
The signatories of this treaty are unanimous in expressing concern for the
welfare of Palestinians living in the West Bank community that
will need to make use of the forthcoming UN emergency aid package.

And the second like this:
We remain willing to collaborate with the UN Security Council and the Israeli government and millitary to forge a positive action plan to help the Palestinian Authority achieve success with its efforts to support innocent civilians.

I could understand the need for enthusiasm. But let me reiterate: THIS IS A FUCKING DATA ACCESS LAYER. I don't normally like to swear, particularly in all caps, but seriously.

There's also a ton of technical statements that are basically phrased like "most people think you can access data in more than one way, but we members of the Entity Zealot community believe there can be only one, and only morons don't recognize that ours is the one true path." For example:
The Entity Framework encourages the Anemic Domain Model anti-pattern by
discouraging the inclusion of business logic in the entity classes.


I'm sorry, "Anemic Domain Model"? Ever heard of messaging oriented applications? Also, how do you propose taking your non-anemic domain model and spreading it over a WSDL boundary? Is there no value in a data-only approach? Normally one might suggest that the article in question merely suggests one possible way of doing things; however, by referring to "data-only objects" as the "Anemic Domain Model anti-pattern", I think it's basically saying only fuck-ups use it.

I'll restrict myself to two more rebuttals, even though I could really get stoopid and just comment on every sentence in this document.

Here's something on lazy loading:
Lazy loading is an essential capability of a data access framework for
entity-based applications. Without lazy loading, an entity-based application’s
codebase will need to include unnecessary prescriptive data loading procedures
for every possible business scenario in which the business entities will be
used.

I'd probably add the following sentence to this quote: "Of course, you will have to augment the built-in lazy loading capabilities of most ORMs with a large amount of optimization hints and restrictions on use to avoid making 47 round-trips to the database every time you ask for a simple set of information, but hey, that's definitely easier than writing a SQL statement. I mean, 'Select Name from People', what the hell does that mean?"

Last one: Here's something on the value of "persistence ignorance":
A team’s ability to do evolutionary design and incremental delivery is
damaged by the Entity Framework’s inattention to fundamental software design
principles like Separation of Concerns.

I always enjoy it when a person writes "Separation of Concerns" but they really mean "Separation of Concerns exactly as I would implement it". Has it occurred to no one that lazy loading, by hiding the fact that property accesses may or may not return to a database depending on current cache state, forces a business application to be heavily dependent on side effects or non-functional behaviors that are generally difficult to understand fully enough to predict with any certainty the final behavior of the system? Isn't it of benefit to be explicit when you say, "Now I'd like you to go to a database, which is historically the bottleneck in an enterprise application, and perform your multi-millisecond activity?"

This is exactly why I stopped working on my custom LINQ provider stuff. I've come to realize that the data access question is simply a problem we've already solved a thousand times, and each solution has its own advantages and disadvantages; the intelligentsia is better served by focusing on technology choices that actually have a direct impact to clients.

One last dig: whether you like it or not, if you are a big ORM advocate you should probably just go back to .NET 1.1 and stick with typed datasets. I've heard all the arguments about what makes ORMs great, and I could argue that typed datasets do each of those features better. (FYI: I HATE typed datasets.)

Tuesday, December 2, 2008

Crazy Canadian Constitutional Crisis

It's amazing that even the current state of Canadian politics fails to captivate Canadian citizens...

Check out this link, one of many that outlines the current pending constitutional crisis:

http://ca.news.yahoo.com/s/capress/081202/national/parliament_crisis

This is actually a bigger deal than people might be thinking. Our government actually operates on a number of assumed rules inherited from hundreds of years of monarchy. For example, did you know that the reason you have to pay municipal tax is based on tenement law, which basically says you owe the king a certain amount of product from what you produce on your land? (That's a bit of an oversimplification but I leave it to you to read the details...)

The truth is that many foreign governments operate with coalition minority parties forming their own government. Israel, for example, has numerous (i.e. dozens of) fringe parties that always seem to meld together to make a government. Even the last Conservative government struck an alliance with whoever it could to make things work. The idea of all the minority governments teaming up to make a new prime minister is not actually that problematic constitutionally (although Stephen Harper would have you believe the communists had stormed Parliament Hill - that's not a statement against Stephen Harper, it's just a comment on the tone of the current rhetoric).

The two real problems are simply this. First, the Bloc has no business in control of anything Canadian. They are separatists and should likely be charged with treason. The only reason they still exist is because they aren't real separatists; rather, they are more akin to the western Reform party a few years back who are just a regional party seeking a better deal for their local constituents. (Perhaps this is the only true form of regional representation left?) However, even though their soft separatist attitudes are probably closer to the American Republican party's allegiance to the no-abortion-no-queers-6000-year-old-universe fundamentalist Christians than any real allegiance to the formation of a new country. (If I were PM: I'd create a document identifying the terms of separation and leave it in Quebec's hands to sign at their leisure. I say this as a Canadian and a francophone. Yes, when I was a kid we spoke conversational French in the house as well as English. Je me souviens.)

Where was I? Ah, yes: an anti-Canadian party shouldn't exist let alone be part of a leading coalition.

Second point: the problem will eventually be solved by Michaelle Jean. Not that she's not perfectly smart and a good human being, but let's all remember that she is the figurehead representative of Queen Elizabeth II. Constitutionally speaking, we'd be just as well off sending the issue to the British House of Lords for a fucking vote. Bash it all you want, at least the American electoral college is a local construct.

Also, we don't pick governor generals because of constitutional law insight. We might as well ask Ricky Gervais how to resolve the issue, and who knows, maybe in a few years he'll be appointed as governor general and he'll be able to weigh in. Will we truly allow the prime minister to be essentially appointed by someone who wasn't even a Canadian citizen until she was asked to be governor general? (Don't get me wrong: she's as competent as any other appointee to the position; I'm arguing that the relative irrelevancy of the position is sufficient to possibly result in a constitutional crisis given the current turmoil. By the way, until she became governor general she was French - not Quebec French, citizen of France French.)

Just as I was writing this my main man Jeff directed me to some Albertan jackass op-ed piece which will probably represent most writing on this topic. Let me summarize for you: "this is a Liberal power grab, they shouldn't be allowed to do this". Thanks, buddy, for your wondrous insight on constitutional and electoral processes. I won't even pretend that this isn't a power grab, of course it is - all political parties seek to gain and hold power. This is no different from the conservatives calling an early election in spite of their promise not to do so during the prior election. The truth is that there are significant questions about this process outside of the perceived or real "power grab" that call to question the Canadian parliamentary system and how it's structured and organically grown.

Monday, December 1, 2008

Ode to Dane Cook

(The following is an excerpt from an email conversation between myself and my old runnin' buddy from Handsome Boy Modelling School, Tall Mike.)

I saw Dane Cook on his ridiculous HBO special, and last night he had a 5 minute bit on some entertainment show where he basically says how he's not nervous about his HBO special even though he's doing something "no one else has ever done before". What is that, you might ask? He was using a round stage with people all around him, instead of a typical stage with everyone on one side and he's in front of them, 'cause standard stage layout is for amateurs, not pros like Dane Cook. Like, what? You fucking invented that? Like, if no one had done that before, I guess they built a custom auditorium just for his stage for the first time ever, right? I mean, what's $800 million fucking dollars for one night with Dane, am I right? No one has ever watched something in a circle before, right? Like, the Coliseum in Rome looks like a fucking ring from 2000 years ago but it's not, it's just some shitty pretend ring because Dane Fucking Cook apparently *invented* it.

And even if he did invent it, it's not like a cure for cancer.

Dane Cook: "Man, I'm so nervous about the show tonight, I changed the auditorium layout slightly, it's going to revolutionize live performance."

Dane Cook Fan #1: "Wow! It's in a circle! I have never seen such magnificence before!"

Dane Cook Fan #2: "I mean, like, if he was just in front of us, I'd be, like, 'okay, that's sorta funny' but all around us it's like, 'damn! That's some funny shit!'"

Like, are you fucking kidding me?

It's not just that he's not that funny. It's not just that everyone in his audience thinks he's the funniest man alive. It's that *he* thinks he's funny. After every joke he looks at the camera with this look on his face like he just said the funniest thing known to man, and just realized it, and was suddenly proud of unleashing such a funny, funny joke.

But the joke he just told and is so proud of himself over was the one about when you just need to have a good cry. Which is fucking ridiculous, because the word on the street is that he's a man. Man up, buddy. Like, don't spend 15 minutes on "needing a good cry". I'm not saying I've never cried. I'm saying I've never needed a good cry, because I am a man. Even a homosexual man would be like, "Dude, man up there buddy."

Yeah, I saw the commercial for that Dane Cook movie and I think I'd rather watch Sisterhood of the Travelling Pants III: Kelly's Revenge. (I assume there's at least one Kelly in a movie like that.) Of course I'm sure he thought he invented movies too.

Will someone explain to me what the attraction is?

Wednesday, October 29, 2008

Thank you, Martin Fowler, for creating a new blog

You might wonder why I am attributing this blog to Mr. Fowler. Well, here's why.

I got a note in my email the other day that looked like this:

From: Justice Gray
Sent: Wednesday, October 08, 2008 10:40 AM
To: Joe Friesenhan; Christians Izquierdo; Andrew Mackenzie
Subject: Only sending this as food for thought

Or fodder for discussion. Honestly!! I’m not even too sure I agree with this entirely, but it’s always good to be challenged…

http://www.martinfowler.com/bliki/AnemicDomainModel.html

-J

So, I read the article. What the article taught me is that, in the computing industry, once you say one or two smart things, everybody starts thinking you are smart, and then you start to get cocky and say things that make no sense. So, I sent back this note:

From: Joe Friesenhan
Sent: Monday, October 20, 2008 1:31 PM
To: Justice Gray; Christians Izquierdo; Andrew Mackenzie
Subject: RE: Only sending this as food for thought

I know it’s been a long time since you sent this note, but I finally got to it and now I just have to say that I now officially think Martin Fowler is an idiot.

The notion that a data-only domain model that allows one to provide logic services (whether heavier impact WS-* based or just internally distinct from the domain model) is actually an antipattern is so utterly purist that I can’t believe he’d record this thought for others to see. I would, in fact, make the opposite argument: is there even a realistic technology model where a pure “data+logic” business domain model makes sense?

Let’s also keep in mind that even if you think I’m a douchebag for being so opposed to this post, I wouldn’t be alone: the core tenet of the Zachman framework is that the what and the how (data and logic) *must* be separate. I remember hearing that and thinking it was too purist as well, and it is, but apparently the entire Zachman framework is an “antipattern”.

Seriously, I don’t follow blogs enough to know if calling Martin Fowler a genuine idiot is some kind of thing the cool kids do these days, but I don’t see how such a myopic point of view that has no grounding in technical implementation savvy can come from someone with such a good reputation. I’d have to say the reputation is unfounded..

I can’t wait for Mr. Fowler’s post on how ignorant the world is for not realizing it is only 6000 years old.

And then, I received this response in return:

From: Justice Gray
Sent: Wednesday, October 08, 2008 10:40 AM
To: Joe Friesenhan; Christians Izquierdo; Andrew Mackenzie
Subject: RE: Only sending this as food for thought


I wish you had a blog.
-J

So, long story short, here I am. I'd like to thank Martin Fowler for giving me the extra push needed to get off my ass and publish my own blog so that hopefully I can undo the small bit of damage his post above has done to the computing industry. And, with Sarah Palin running for the vice presidency of the USA, there's a *lot* more to cover!