Author’s Archive: long2know

Home / long2know
245 Posts

Recently, I had a conversation with another developer about the role of DBA’s in the development process. It was immediately clear that, philosophically, our viewpoints diverged.

The conversation digressed, and I found that this developer was completely against using ORMs to make queries. The term ‘ad-hoc queries’ was bandied about quite a bit. This other developer also went so far as to tell me that, in a code review in ‘hard-core’ dev shops, ad-hoc queries would get smacked down.

More Link

One of my biggest areas of struggle is in writing unit tests.

I enjoy all of the mocking frameworks, like Moq and Automoq, but I find that after mocking up so many interfaces, I question whether the unit tests have value.

More Link

In my previous post discussing profiling Entity Framework, I alluded to DbInterceptors as being able to provide lots of useful functionality. In this post I’ll expand on the DbInterceptor and show a few optimizations / manipulations that I like to perform on EF’s generated queries.

More Link

I’ve really enjoyed running WordPress. However, there are a few features that plugin authors overlook or don’t consider. One such problem that I ran into was with the Social Login plugin that I use.

This is a great plugin (Social Login), but it was not loading profile images over HTTPS. While this may not seem like a big deal, it did make it so that a browser would report an issue with my site. This was a bit of a show stopper for me after the effort I put into getting certs/https/etc set up.

Fortunately, thanks to the flexibility of WordPress, and PHP in general, it wasn’t too terribly hard to fix.

More Link

As I’m moving more code that I’ve written in the past to my blog, I remembered I posted this code a long while on CodePaste. It allows you to send an SMS text message via your Google Voice account.

It’s a simple bit of code that’s authenticating via your Google account and then getting the proper auth codes in order to send the text message.

More Link

Profiling a ‘black box’ framework to see exactly how it works and behaves can be edifying. It can also lead to better optimizations/usage of the framework. In my case, it helped diminish the mistrust of Entity Framework.

There are tools like Rhinomocks EF Profiler which allow for inspecting the ObjectContext of Entity Framework. However, if you don’t want to buy additional tools, you can effectively write your own.

More Link

I’ve used T4MVC within my MVC projects for a long, long time now. It’s one of those extremely useful utilities that probably gets forgotten.

At any rate, I’m not sure if I ever mentioned why I like T4MVC, but here are a few reasons.

More Link

Using Stored Procedures in the latest version of Entity Framework is pretty doable. You lose a lot in terms of flexibility, but sometimes there are trade-offs that one must make. This week I was playing around with converting an application that used a Repository pattern with EF, Lambdas, and IQueryables to StoredProcs for all CRUD operations.

Here are some interesting bits that I learned.

More Link

Recently, I was reviewing some old code to see why it was performing poorly. The code in question was Database specific and was using an Entity Framework 4.4. Of course, many people wanted to immediately blame it all on Entity Framework.

Personally, I’m not so quick to condemn a framework. Frameworks usually do what you tell them to do, but only as well as you instruct them. From my experience, most of the time when a framework behaves badly, it’s not the framework’s fault. It’s usually due to poor utilization and understanding of the framework.

More Link

Here’s something I learned about Url hashtags a while back that seemed worth sharing.

As you may know, hashtags are never sent to the server. There is, by regular browser redirection, no way to get hashtag information to the server.

For a client-side script based web application that uses hashtags, obviously, this presents a challenge. Even if all you want is a redirect url on login, it can’t utilize the hashtag.

One work-around that I found that works well is to redirect to a page that has a hidden HTML input which you can stuff the hash (url encoded) into and then post that as a named/value pair to the server.

More Link