Enterprise Library 2.0 File and Line Count

posted on Tuesday, January 24, 2006 12:27 AM by kfinley

I was looking around tonight to see if many people have been blogging about the new EntLib release and came across an interesting post. It is a little dated (6/1/2005) and is really talking about the EntLib 1.0 release, but still it got me thinking. The post is from Chris Breisch and his main point is that he considers the Enterprise Library to be overly complex and difficult to setup and use.

After reading his post and the accompanied comments I agree with some of what he has to say. I agree the EntLib is a very large chunk of code and there is some complexity underneath. But I have been working with the EntLib since the 1.0 release and I don't feel that it is overly complex. I personally think that it's not that hard to build extensions to the blocks or even build new blocks to fit in line with the EntLib framework. I did have some initial issues with deploying apps but after doing some research and testing I was able to build installers that deploy applications using the Enterprise Library without any problems.

After reading Chris's post I thought I would do a little initial digging and compare the older version of EntLib with the newly released EntLib 2.0 version. I thought to myself "How big is the new version?" I've been reading a lot about how the new configuration works and details of Object Builder, but I haven't stepped back and just looked at the amount of code included in the release.

One thing that caught my eye with the original EntLib release was it's pure size. When you open up the EntLib solution it is a little surprising how much stuff is actually in there. So my first high level comparison I thought I would use my simple line counting script to do a very unscientific comparison of the 2.0 release with the 1.1 release. All I'm looking at here is the total number of files and the total number of lines within the files. The script counts every single line including whitespaces and comments. So really it is not an official line count of the code, just a rough estimate really, but good enough for getting a basic idea. Before doing the comparison I expected there to be some difference considering the removal of the configuration block and most of the security block but with the addition of Object Builder and some of the other changes I wasn't sure which would win out for overall "smallest". Also note that the numbers here represent only the framework code and does not include the Unit Tests included in each release. Below are the results from the comparison.

Component
EntLib 1.1
Files Lines
EntLib 2.0
Files Lines
Complete Library 922 101198 938 95327
Caching 107 9101 101 9566
Common 19 3417 100 8321
Configuration 234 29416 134 16723
Data 66 9288 71 7478
ExceptionHandling 64 6384 63 5816
Logging 167 15919 178 21549
Security 231 22106 213 20584
Other (such as Tools [1.1] & ObjectBuilder [2.0]) 33 5531 77 5263

As we can see the EntLib 2.0 release wins out on least amount of lines of code, but losses on number of files. The new release is only about 5,800 lines smaller than the previous release, which really isn't much. I expected the Security Block to have been reduced a lot more considering the features that were removed, but we can see that both the Exception Handling Block and Data Access Block were trimmed down. Some things were moved around in the namespaces including the configuration console which is now located under Configuration instead of Tools, this explains the size of the Configuration namespace in the new release.

This test doesn't tell us much but after reading Chris's post I wanted to see the initial results. Now that we've found that the code footprint is not really smaller the question remains, is the new release overly complex and difficult to setup and use? I've not done any extensive work with the new release so I can't give an opinion yet. I've been reading about Object Builder and Dependency Injection and like what I've seen so far, but I'm sure some will feel it is overly complex. Hopefully I'll be using the new release in more depth soon so I can post more on my thoughts and experiences with the new release.

Now Playing: Ozma - The Doubble Donkey Disc - The Business Of Getting Down (Flight Of The Bootymaestro)