Architectural frameworks and reusable code
- Posted on May 22, 2015
A few weeks ago at Microsoft Build Developer Conference there were a lot of announcements that got people cheering and clapping but one stood out over all the others and it had nothing to do with holographic robots.
We have a long history of reuse within Avanade. In the early days of .NET we created the Avanade Connected Architecture for .NET - ACA.NET. A collection of connected reusable modules providing commonly required functionality and simple wrappers around complex or error prone operations. The benefits were obvious. With a rapidly growing company of developers where everyone was new to .NET, ACA.NET brought productivity (reusable code they didn’t have to write or test internally), quality (it provided a framework that prevented common developer mistakes and consistency (most web and client applications we wrote used the same framework).
As teams started to understand the frameworks, the benefits snowballed and skills from one project helped accelerate the next. After over a thousand projects, a few patents and numerous awards, ACA.NET eventually became what we know today as the Microsoft Enterprise Library and some of the original innovation was merged with the core .NET Framework.
The world of Microsoft development today is different from 15 years ago. The rise in the quantity and quality of open source software and the increased flexibility and expansion of the .NET Framework with features like ASP.NET MVC mean that the scope for large architectural frameworks has diminished, but the principles they upheld and the benefits they brought are still important, now more than ever.
Package managers like Nuget or NPM are great and they have transformed the experience of consuming open source frameworks from an absolute nightmare of configuration to an elegant and rather pleasurable (and reversible!) experience. But they are also open to abuse. While most well-known packages are robust, secure and supported there are many, many more packages that are the opposite. It’s all too easy for someone to publish a package with a glossy Bootstrap’d site and, before you know it, your most critical systems are running on code you didn’t write, don’t own and can’t support.
Responsible organizations tend to try to exert a certain level of control through some sort of Architecture Authority with oversight over such things. Today’s organizations not only have to deal with the flow of open source software into their code base but they must also tackle the age old challenges of productivity, quality and consistency. They need to address these for their own ends but together, when harnessed, create an aura of predictability that reinforces confidence in the organizations ability to produce and maintain software. Something on the watch list of every CIO.
We get approached regularly by organizations looking to retake control of their software through the use of reusable components and frameworks. The nature of the process of software development relegates reuse down the value chain and it’s not helped by the fact that it isn’t easy to do. Those who have tried know you can’t easily share assembly files for an evolving framework, and sharing source is equally fraught with issues. To compound this, the growth of Agile best practices and the focus on immediate value and working software generally leads to the categorization of reuse as technical debt, and let’s be honest; it never gets done.
This is why I’m so excited about Microsoft’s recent announcement. Scott Hanselman revealed that package management will become the de-facto method of sharing components for the Core .NET Framework.
When you reference other projects or even Core Framework assemblies, they get added as packages and when compiling assemblies they get output as packages (Nuget by default). This, I think, will encourage a different mind-set when it comes to structuring your solutions with a greater focus on assembly reuse beyond the immediate solution. When assemblies are so easily packaged, published and consumed with a mature and robust approach to version control, organizations now have the potential to seriously accelerate code reuse, develop solutions with a reuse first mind-set, and reap all of the rewards with none of the drawbacks.