We Are Not Gods

There is a risk that we, as technologists, may become drunken with the power that knowledge gives us over the non-technical folk. They look to us for answers because we have the Dilbert Knack, and they trust us to really know.

Capricorn

And just when we fall through the rabbit hole of illusion that such power creates, when we have decided that we are gods, knowing and seeing all, those pesky humans, mere mortals they, go off and make a business-driven decision that runs contrary to every tenet of elegant design and best practices that we have graciously delivered to them at great sacrifice to ourselves on digital tablets for their own good because they cannot possibly know what is good for themselves.

Our ego blinds us to the truth. We are not gods. And when the business people reject our ideas, only humility will prevent us from making complete fools of ourselves. 

Indeed, we can only be truly effective when we come to understand that we serve at the pleasure of our employer, and we want to serve their interests but understand our place as a servant. We can gently persuade. We can teach. And we can be there when things go south, having the wisdom to never say, "See. I told you so."

Wrapping Up and Moving On

I've been laid off and the reasons don't matter. It's just business. My last official day is tomorrow. My soon-to-be former employer has a product that enterprises need and good people to back it up. Happily the future is bright and there are opportunities in the world of technology for the taking.

I'm excited for the future and know that soon I'll be doing something new, interesting and challenging. The friends and colleagues I leave behind will do well in the technology economy no matter where they go.

It's a prosperous time to live if you have valued technical skills. I'm grateful for all of the experience I've had that has brought me to this point. I look forward to utilizing it to help other organizations solve their technology problems and advance their organizational goals.

I believe that whatever changes the future holds, I will continue to blog from time to time and work on my personal OSS projects. Stay tuned.

How Photography Helps Me Be a Better Software Architect


arizonahighways

I want to share with you how my efforts to perfect my semi-commercial hobby of photography help me be a better software architect.

My first camera was a Kodak Pony 135. I had no idea what I was doing, but I learned a lot by experimenting with that camera. My first computer was a Commodore 64. I was only slightly more informed about computing, having learned BASIC on a Commodore PET over two years prior. Again through experimentation and reading every Creative Computing magazine that I could get my hands on, I learned much more about computing and programming.

So now you know that I've been doing photography and computing for longer than many of my colleagues in this business have been alive. Let's see if my insights are of any use to you.

Patterns in Composition

In photography one must always be aware of the composition of the shot. How do the elements of the shot work together to draw the eye to the subject, to the story you want to tell? Learning the rule of thirds can be quite useful in understanding that, as in photography, so too in software we must look for patterns of composition to focus the user experience on the desired outcome. These patterns are often not visible to the untrained eye, just as in photography our audience may not really know why they like the photo, but they do. Software users will know they love or hate the software, but only you will know they love it because you composed it using patterns that make the magic happen.

Following a Process

We rarely get something right the very first time we try it. We're more likely to get something right when we follow a process that has led to success in the past. In photography I have learned that I must follow a process of preparation, analysis, exploration, decision taking and execution. A well thought out process in software development is equally crucial to success.

Breaking the Rules Sometimes

Once you know the rules of your process and craft, you can begin to take some risks in breaking the rules to achieve a desired effect. Only after understanding the rule of thirds in photography and knowing how and why this rule will help you compose your shot in a way that will present your subject well can you begin to experiment with breaking that rule to tell a slightly different story. The same is true in software architecture. Knowing how the rules of SOLID and design patterns will help you achieve the best outcome is crucial. Only then can you begin to experiment with small deviations to the rules to find new an innovative ways to achieve your goals.

Knowing Your Subject

In photography one must know something about the subject of the photograph. The more you know about the subject, whether this is a person, a landscape, a flower or a bug, the better you will understand how to draw out the character of your subject in your photograph. Being a software architect means knowing your subject, your users, stakeholders, the data and systems and the processes needed to make things work. The more you know about that, the better your architecture and design will be and the happier your customer will be.

Best Tools Don't Always Make the Best Work

Some photographers believe they must have the best, most expensive equipment to achieve the greatest possible result. This just is not true. I once shot with a full frame camera and now shoot with a Micro Four Thirds. Some day I'll move to medium format for other reasons, so don't discount having great tools, but don't assume that without the best you cannot produce great work. The same is true in software. We do not always need the best IDE or the most powerful laptop or the biggest amount of RAM to achieve the best result. Indeed if one focuses only on the tools, one might overlook the fact that one's work is to produce something great with the tools you have. Focus on the finished product and whine less about the tools you have been given.

Always Something Beyond Your Control

In photography you cannot control the weather or an unruly portrait subject. You cannot decide when your SD card will fail. You cannot guarantee that every shot will be perfect. There are always elements of the work that are out of your control. To succeed one must embrace the unknown and unexpected. In software architecture this is also true. There are many aspects of a project which you will have the ability to control. Time and business demands are not among them. Resource availability or team skills are not always within your control. You must learn to embrace the things that are not under your control and work as well as you're able to achieve your goals in spite of these.

Try Again Tomorrow

When I'm shooting landscapes, I often think that I've nailed it only to learn in post processing my RAW images that I failed to capture what it was I thought that I had seen when I was in the moment. These failures fall to the digital cutting room floor and push me to go back out and try again. There is a reason we have iterative processes in software development. We don't always get it right. We must continue to hone our craft and work and rework until we do get it right. Even then there is always more we can do. Sometimes the most important aspect of courage is simply to say to oneself, "I'll try again tomorrow." (Taken from a favorite saying borrowed from a friend of mine who passed away recently.)

People and Love Are The Most Important Ingredients

In photography and software architecture and development, I have learned that the most important aspect and ingredient to success is people. The people we work with will come from many different backgrounds. They will have different needs and desires. We must learn to love them and work with them. Only when we do this can we achieve our greatest success because our success depends on their success. When you love the people with whom you work, you will want to see them succeed. You will be kind but honest. You will be patient but urge them to do their best work. You will put their needs ahead of your own. Miraculously you will produce your very best work and so will they.

Allow Your Models to Cross Only One Boundary

Don't let your models cross more than one boundary. Sure there may be exceptions, but I haven't found one that justifies the loss of flexibility achieved when requirements change.

Some years ago I worked with a thoughtful and intelligent programmer named Nick. He convinced me that models, or data transfer objects (DTOs) should not cross more than one service or domain boundary. I was skeptical at first. It seemed like a lot of duplicated code.

He talked me into it. And the next time the business changed a requirement, which of course happens often in most software development shops, I became absolutely convinced. We added something to one model, changed the code that produced the model and the specific code that consumed the model without breaking all other users of other endpoints that used the underlying models and entity models or services that produced them.

Here's what it looks like in one implementation:

models

Of course, your own architecture may involve more boundaries than shown here. You may have a message queue or services bus. I believe the principle still applies.

The greatest advantage is that you have an abstraction layer at every boundary that allows you to move swiftly when you need to support changing requirements. And I've never met a company or set of software developers that do not deal with regularly changing business requirements.

This is a very opinionated post and if you balk at the notion at first, I urge you to at least give it a try. You will find that you can enforce separation of concerns. You will find that you can avoid having a dependency on a framework, such as Entity Framework, in your application server code or in your hard wired client code, the latter of which would need only a reference to your ViewModels assembly. (Assumes you are working in .NET but I believe the principles apply universally.)

You will find that in preventing your business logic from knowing anything about the implementation of the interface provided by the Models assembly, you are forced to inject the dependency and are thus free to replace the dependency with a different implementation or even a mock for unit testing.

The list of benefits is long and I've surely missed a few important ones, but you get my drift. I hope.

TIP: Use AutoMapper or something like it to help you with the tedium when transformations are an exact 1:1 match.

Microsoft REST API Guidelines

I’m a big believer in establishing standards for your REST APIs. I like this one from Microsoft but there are others. What I like about this particular guideline is the structural organization and its brevity. The introductory paragraph provides the reasoning and justification behind REST even when there are language specific SDKs made available.

Developers access most Microsoft Cloud Platform resources via RESTful HTTP interfaces. Although each service typically provides language-specific frameworks to wrap their APIs, all of their operations eventually boil down to REST operations over HTTP. Microsoft must support a wide range of clients and services and cannot rely on rich frameworks being available for every development environment. Thus a goal of these guidelines is to ensure Microsoft REST APIs can be easily and consistently consumed by any client with basic HTTP support.

One thing that would be nice to have is a standard for filtering, paging, etc., on the URL as query parameters. These get defined differently by every REST service architect out there. Or so it seems. A good jumping off point for some research and thought.

And I want to thank my friend Pablo for sending me the link to this.

Agile and Architecture

One of the most misunderstood and misrepresented documents in the history of software development is the Agile Manifesto. This may be due to many of its readers overlooking the phrase “there is value in the items on the right.” Most seem to focus on the items on the left only. Here’s the text that Cunningham, Fowler, Martin and other giants in the field created:

Manifesto for Agile Software Development

We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

That is, while there is value in the items on the right,
we value the items on the left more.

Note that I have emphasized the items on the right. These do indeed have value but so many advocates of Agile deliberately ignore and even exclude these from their software development process and organization. Some have advocated the elimination of architecture and design entirely, leaving these open to gradual discovery through the iterative process driven by use cases and user stories and backlog tasks.

Recently I have read a number of discussions, blog posts and articles on the question of Agile and architecture. The comments and discussion around the topic have been interesting. Perhaps this is due to the notion that developing software is only about writing the code. The general theme of these sources is that architecture (and design) are at odds with Agile. This is one of the great fallacies of our time.

Architecture and Design are Software Development Artifacts

Teams and organizations who skip architecture and design will sooner or later find themselves off track and repeating work unnecessarily. Such waste is not entirely preventable, but this does not mean we should not try. Teams that incorporate these activities into their iterations, regularly revisiting architectural questions such as non-functional requirements and component design, will find that they are better able to stay on course.

Organizations that have multiple teams will find greater stability in moving forward when guided by a centralized architecture team, comprised of architects or leads who are dedicated to and work within the organizations development teams. The architecture team works in an Agile fashion, with its own backlog and its own products including working prototypes, cross cutting standardized components, documentation of the architecture and designs, and work items to be placed on the backlogs of development teams.

In this way, development teams have dependencies on the architecture team and can make requests for additional guidance or improvements or extensions to shared, standardized libraries for which the architecture team is responsible. These requests keep the backlog of the architecture team charged with work throughout the software development lifecycle.

In addition to formal activities to improve architecture and design across the organization, the architecture team should regularly interact with development teams to include (but not limited to) the following:

  • practice improvement activities—e.g. SOLID principles
  • technology deep dives—e.g. digging deeper into .NET
  • technical solutions brainstorming sessions—solving the hard problems
  • technical debt evaluation and pay-down planning
  • code reviews and walkthroughs—one on one and as a team
  • presenting and sharing solutions and ideas from other development teams
  • exploring and evaluating new technologies and tools

Like testing and coding, architecture and design are a part of the whole of software development. These activities are perfectly suited to Agile development practices, including SCRUM. And when all of these aspects of delivering quality software are taken into account and incorporated into your Agile process, your chances of success are greatly improved.

----

P.S. And if you add to all this a great dev ops team to support your efforts with automated build and deploy systems, your life will be that much easier and your chances of success are automatically improved.

The 4+1 Architectural View Model v2

You can find the well written brief on Phillippe Kruchten’s 4+1 architectural view model on Wikipedia along with a link to the original white paper published nearly 20 years ago. Kruchten worked for Rational, as I understand it, and so this is often referred to as the RUP 4+1 model.

4p1Architectural_View_Model
Courtesy of Wikipedia

Although I have used this model or some variant of it at times, I had quite forgotten its name and origin until someone reminded me of it the other day. Of course, we often forget that UML also came out of Rational’s famous Grady Booch, Ivar Jacobson and James Rumbaugh..

And yet today I find it difficult to find software developers who know much of anything about the 4+1 model and only a few regularly use UML and even then only for simple class diagrams. So why the disconnect?

Perhaps a Version 2 of these approaches is required. What would you get if you mixed the 4+1 model with more clearly defined non-functional requirement scenarios as I’ve previously discussed and the C4 model presented by Simon Brown along with just a bit more UML that most developers are not currently accustomed to using? I’m thinking this through and will post more thoughts on it soon.

Venn-like View of Software Quality Attributes

Two days ago I posted Non-Functional Requirements for the Software Architect in which I suggested that quality attributes or non-functional requirements could be categorized into a two by two grid, operational and non-operational by internal and external.

Thinking further along those lines led me to picture the illustration below and hop out of bed to put it to virtual paper.

qualattribvenn

Most quality attributes will fit into one or two of the big four: security, performance, usability and modifiability. And each of these largely corresponds to its depicted quadrant.

Security is largely an internal concern. Often external stakeholders will profess their concern with this attribute, and hence the Venn-like spill over into the external quadrant. Generally the concern for security and assuring security falls within the domain of internal stakeholders and the implementation team.

External stakeholders are mostly concerned with performance and usability. There are a number of other quality attributes such as availability that fall within or at least are closely related to one or both of those.

Modifiability is almost exclusively a concern of internal stakeholders and implementation teams. Interoperability and testability are largely related to modifiability while interoperability nearly always shares at least some security concerns.

You may mix these differently to match your circumstances and priorities, but the illustration covers the majority of software development efforts but of course does not spell out the details. For guidance on that, I recommend my previous post. If you are concerned with software architecture, perhaps this will help you to visualize how these quality attributes or non-functional requirements compete and compliment one another.

To paraphrase Bass in Software Architecture in Practice, an architecture will either inhibit or enable the achievement of a system’s desired quality attributes. Understanding your desired quality attributes well will drive the critical decisions in your architecture. And your architecture will then provide the requisite containers into which you will place your functionality. To quote, “Functionality is not so much a driver for the architecture as it is a consequence of it.”

While I am not completely certain that is always the case, it is a principle that is well worth considering when creating and refactoring the architectural elements of your system. And it is my hope that by seeing this illustrated, it will get you thinking about how your own desired quality attributes interact with internal and external teams, which are operational and non-operational, and how they may compete with or compliment on another.