Onion Architecture: Part 4 - After Four Years

 In 2008, I coined a new pattern name called Onion Architecture.  You can read the previous parts here: part 1, part 2, part 3.  Over these four years, I’ve spoken about this pattern at user groups, conferences, and it’s even published in one of the chapters of ASP.NET MVC in Action from Manning.

I’ve been overwhelmed by the traction this pattern name has enjoyed.  Folks from all over the country have written about and have talked about the pattern.  Some of the ones I’ve noticed are here (please comment with more – I welcome it).


Back in 2008, I defined four tenets of Onion Architecture:

  • The application is built around an independent object model
  • Inner layers define interfaces.  Outer layers implement interfaces
  • Direction of coupling is toward the center
  • All application core code can be compiled and run separate from infrastructure


Although there has been significant adoption of this pattern, I have received countless questions about how to implement it in various environments.  I mostly get asked about how it relates to domain-driven design.  First, onion architecture works well with and without DDD patterns.  It works well with CQRS, forms over data, and DDD.  It is merely an architectural pattern where the core object model is represented in a way that does not accept dependencies on less stable code.

CodeCampServer was an original sample of onion architecture, but it also grew as a sample of how to do ASP.NET MVC in various ways, how to use Portable Areas, and how to use MvcContrib features like input builders.  If you are just looking for onion architecture, it has too much going on.  I have pushed a much simpler solution that represents onion architecture concepts.  I have intentionally not included a UI input form or an IoC container, which most people associate with onion architecture.  Onion architecture works just fine without the likes of StructureMap or Castle Windsor.  Please check out the code here and let me know if this presents a simple approach – that is the goal.

When there is enough interest, I will continue this series with more parts.  CQRS definitely deserves some addressing within this architecture, and so do object models that support task-based UIs.

Get the code here at my BitBucket repository.

How to configure SQL Server 2012 for remote network connections

SQL Server 2012, especially when using a named instance, changes the way us old SQL Server veterans manage connectivity to the server.  We are so used to relying on port 1433 for SQL Server that setting up a new SQL Server 2012 database server might give us some fits.

I have one software engineering team that just did this recently.  Our dev and test environments are in Windows Azure, and then our production environment is in a specialized data center on the east coast of the U.S.

To make a long story short, we are using Azure’s point-to-site VPN so that none of the servers can have any contact from the outside world.  The only way to get to them is to VPN in.  Then, the servers respond to pings, and it’s as if they are on the LAN.  It works great – except connecting SQL Management Studio to a new Windows Server 2012 box running SQL Server 2012 wouldn’t work.  All the old tricks of using SQL Configuration Manager and enabling TCP/IP yielded no fruit.  And opening port 1433 on the firewall yielded no fruit as well.

Just for completeness, we were using a named instance, not a default instance.  A quick look at NetStat revealed that SQL Server wasn’t listening on port 1433 at all.

Notice how port 1434 is listening, however.  This is the SQL Server Browser service.  A search through the documentation reveals that Microsoft has made a bit of a change to the way SQL Server operates regarding ports.  These named instances now use dynamic ports – I think for security.  This TechNet article explains that to connect, the client will send a UDP packet to port 1434 first to resolve the dynamic port.  Then it will connect as normal.

The appropriate Windows Firewall rule to establish is a program rule, not a port rule.

By adding SQL Server’s exe as a program rule in the firewall, it now works.

It’s been several versions since something like this has changed in SQL Server, so hopefully this article will help someone else using SQL Server 2012 for the first time.

GoToMeeting works great–until you add video conferencing

I have been a loyal customer of GoToMeeting for years.  I love the cost, flexibility, screen sharing, and audio quality.  It works very well.

In 2013, I’ve started using the video conferencing feature much more heavily – meaning, I’m using it.  At Clear Measure, we have teams in Austin, Dallas, Toronto, and New York.  On top of that, our clients like to connect to us from wherever they are.  The phone conference dialing is very useful, and the smartphone app is great as well. 

The issue I have found is that the video conferencing takes a remarkable amount of CPU time.  Many team members have difficulty using video conferencing when other process are running on their computers.  Webex, on the other hand, appears to degrade video quality in that case.  GoToMeeting seems to require full video quality and audio quality at all times.  And when the CPU can’t keep up, audio and video just cut out and stop working (dropped packets/words/sentences).

Here is GoToMeeting running without video (call with 5 people – my webcam is off, other 4 webcams are streaming)

GoToMeeting without video

And here is GoToMeeting running with my webcam turned on.

GoToMeeting with video

If I could have my way, when faced with constrained CPU cycles, video quality would degrade first.  Then screen sharing quality, then audio quality, The current behavior has me shopping for other solutions.  I’d be interested knowing other experiences.

Onion Architecture for Distributed Systems at Austin Code Camp, 2013

Kudos to the Austin .Net User Group for organizing another Code Camp!  I have submitted a very interesting talk (in my opinion). It is Onion Architecture for Distributed Systems.


Onion Architecture is an architectural pattern for keeping libraries and dependencies on the extremities of a software system while building a strong and cohesive system core.  Distributed systems like those that leverage NServiceBus and Enterprise Service Bus (ESB) products have characteristics that challenge layering principles of non-distributed systems.  This session will show how to properly structure and layer a .Net/C# software system that makes use of Onion Architecture, NServiceBus, and ASP.NET MVC.  The target audience for this session is:  C#, architect, senior engineer, team leads/lead developers.


If you are interested in speaking at the Code Camp, please submit a talk.  http://codecamp13.adnug.org/speakers.html

Let’s build some software together. I’m hiring senior devs

Job listings are always difficult.  Ok, if you want to see them, you can go here.


We are gearing up another team for an exciting new software project.  Working with some industry veterans, we are building a new product for a financial-sector company.  We are coming on board as their software engineering department providing everything from the architecture, development, QA, and ongoing operations, maintenance, and support.

The technology platform is great, too.  This system is going to have some of everything: ASP.NET MVC, some SPA, some NServiceBus, some SQL Server, some BI/big data, plenty of Azure, and rock-solid SCM/continuous delivery practices built on a bed rock of test automation.

You’ll work co-located in Austin at Clear Measure headquarters in Plaza 7000, a great, class A office building with blazing-fast internet, as many computer monitors as you want, and the latest Windows 8 machines.  Ok, big company benefits, too (United Healthcare, 401k, training, etc, etc – we cover 100% health/dental/vision for employee & small premium for family)

This is one of the projects that I’ll be personally setting in motion, so let’s work on the architecture together.  Give me a comment, email at jeffrey [at clear-measure.com.  Maybe you are good where you are, but this is a competitive job market.  If you recommend & introduce me to someone I hire, I will pay you $1,000!!

Disclaimer: In Austin, US citizen

AzureAustin is a new user group–meeting June 17

AzureAustin is a new user group that meets at the Microsoft office.  It is dedicated to the mutual benefit and learning of its members.  The group is sponsored by Microsoft, Clear Measure, Team Venti, Veeam, and many others.

Microsoft has been strengthening its Azure platform for quite a while now, and the capabilities are astonishing.  It seems like every few months, Scott Guthrie comes out with a new blog post outlining the new capabilities that have come online.

Come to the June 17th meeting where Joe Reynolds from EPS Software will discuss Integrating source control with an azure project.

With Azure, you can integrate your online source control with your projects – allowing you to automatically deploy your CI builds to Azure. This session will demonstrate using various source control platforms – TFS, GitHub, and CodePlex, among others, and integrating them with an ASP.Net MVC application. 

Joe Reynolds is a Senior Developer at CODE Consulting. When not working in the office, or at home, Joe can generally be found at St. Jonah Orthodox Church, or at one of the many User Groups in which he regularly participates. Recently, he accepted a board position with the North Houston .NET User’s Group and is the Chair of the IT advisory board for Lonestar College.

Joe Reynolds is a Senior Developer at CODE Consulting. When not working in the office, or at home, Joe can generally be found at St. Jonah Orthodox Church, or at one of the many User Groups in which he regularly participates. Recently, he accepted a board position with the North Houston .NET User’s Group and is the Chair of the IT advisory board for Lonestar College.

Move over TortoiseGit, welcome SourceTree

imageSince around 2005, I, and teams I’ve led, have been using the Tortoise flavor of source control clients.  TortoiseSVN, TortoiseHg, and TortoiseGit.  Each came with the command-line client as well for specific use cases, but most of the time, we used the Windows explorer shell integration.  To this day I’m using TortoiseGit with GitHub, BitBucket, and Team Foundation Service+Git.  It works well with all of them.  I’m not sure why it took so long for me to figure out that Atlassian has a Git and Hg client called SourceTree.  Here is what it looks like, and it seem to work seamlessly with my existing repositories and working copies.  In addition, it integrates diffs very well so that it’s obvious right off the bat what has changed in the file. 

One feature that SourceTree does not provide is explorer shell integration so that I can right-click on the repository working copy and perform functions directly from there.  It will remain to be seen how often I reach for TortoiseGit with the new slick interface that SourceTree has.  I’m not sure, but I don’t think it will take long to see.

Announcing Party with Palermo: DevTeach 2013 edition!

Jean-Rene Roy has graciously helped to sponsor a Party with Palermo at DevTeach in Toronto.  If you are not yet signed up for the conference, please head on over to www.devteach.com.

If you have already signed up, make sure to RSVP for Party with Palermo on 5/29 at 6:30PM.  Also on the schedule for that evening is a .Net Rocks show just for the 10th anniversary of the DevTeach conference!

RSVP now!


Team Foundation Service my new default GIT repository

imageGIT works great with the new Team Foundation Service (TFSvc?).  I’m an old school Tortoise guy (SVN, Hg, GIT), but I had to laugh at the little branding touch they through in when doing a pull.

Notice the Visual Studio logo in ASCII art.  I’ve actually been using it for some time, but I hadn’t notice that until today.

The good news is that this is just GIT.  Not some Microsoft GIT build, but it’s regular old GIT hosted for me and integrated with the other TFS features like work items, story boards, etc.  All I have to have is Microsoft accounts for my team members, and it all works.  We have three systems hosted here now, both code and work tracking.  One is an HTML5 smart client, one is a C++ system including some MFC as well as driver code, and the third is an ASP.NET Web API system with NServiceBus back end.  In short, it doesn’t matter.  It’s just GIT.

I do like the work item tracking at the story level and at the task level.  And the visualization works well also.


The stories are the rows on the left, and the sticky notes are the tasks that are what needs to be done for this story to be completed.

In short, they did a good job with Team Foundation Service.

Launching AzureAustin user group May 13, 2013

On May 13, 2013, I’m launching a new user group, AzureAustin (please RSVP so we can plan food accordingly).

For those who know me, you know that I led the Austin .Net User Group for 5 years, that I was on the founding board of directors for AgileAustin, and that I co-founded AgileATX (now known as ATX Code Lunch – and superbly facilitated by Chad Myers).  I’m launching this new group because the nature of the data center is changing rapidly, and Microsoft is one of the big 3 lending momentum behind the trend.

I also see the Microsoft technologist having a key role to play in the new DevOps world, and this group will be central in bringing together developers and technologist responsible for running critical software systems for their companies.  By coming to together, sharing successes, and discussing challenges, we can mutually sharpen each other and learn from each other.  This group is sponsored by Microsoft and will be held at the Austin Microsoft office.  In addition, each month will have a food/drink sponsor for dinner.

At 5:30, please arrive for 30 minutes of networking and getting started with the food.  The business meeting/presentation will begin at 6PM.  We will conclude at 7:30 and have final announcements and a give away drawing.

Please share this with all you know: managers, executives, developers, I/T admins, and anyone who has a hand in developing and running business software systems.  Along with Windows Azure, we will discuss all relevant topics around the technologies used to build and operate systems that can run in Windows Azure.

I look forward to seeing you there.  Please contact me if you have any questions about the group, or if you would like to volunteer to help make the group better!

And RSVP for the first meeting!