Can we boilerplate software architecture?

105

I have been programming for 12 years commercially now since I was 18 years old and fresh out of college, however I have been programming just for the love of it for close to 20 years.

In the early days I would describe myself as a “furious coder”. I could produce 3,000 lines of code each day (sustained for years), whilst producing slightly less bugs than my colleagues.

After a year or so I noticed that logical separation of code was really important. So I created tiers (usually separated by process) so presentation, business/domain logic (BL), and data access (DAL) were all isolated.

Soon after I realised that separating logic was really really important. So started separating logic not just by tier but by integration (interoperability with remote systems) and implementation (project/customer logic). This created some pretty agile results that responded well to change.

Finally, I started reading about the SOLID design principals and my whole outlook on programming changed forever. I soon realised how hard software architecture actually was. By coding furiously, the “architecture” of each solution was incidental; areas such as exception handling, damage control and overall object responsibility were a constant challenge that I fought daily. I’d often “fix” a bug, only to find that actually all I’d done is push it into another “responsibility realm”.

From then on I started working as Product Director at a security software company (near London, England). My personal focus has since been achieving the best possible software architecture, which could be reused elsewhere (read anywhere). The main challenge for the company was that we had a single software product that spanned retail, government, healthcare and financial verticals – a product that needed to be everything to everyone; for that modularity and the ability to quickly implement new integration code and implementation logic (even logic that conflicted between customers) was a necessity. At this point another separation was key: customer implementation logic needed to be kept separate, especially the parts that customers owned the rights to. Also, modules could then be sold off or made exclusive to a partner, without compromising the product itself.

I realise that there is not always a “one size fits all” for software solutions, but I do believe that all software solutions share similar requirements. They all need:

  • Isolated, configurable “modules” separating tiers, responsibility and customer-specific logic
  • Cross-cutting “aspects” such as logging, error handling, debugging aids (eg. performance counters)
  • A sensible approach to exception handling, including damage control
  • The ability to easily change the behaviour of components once the solution is deployed using dependency injection
  • A way of communicating between modules (M2M) even though modules are highly isolated
  • A way of keeping track of dependencies and a method of avoiding the entourage anti-pattern
  • Configurable workflow logic that defined the movement of data between logical tiers
  • A decision engine that allowed complex rules to be created, affecting the flow of data between modules

To that end, I believe there is probably a way to create a boilerplate architecture that will fit most software projects and I think I am pretty close to achieving the first iteration of this design. This would be platform, framework and even language agnostic.

Most have spent their energies developing new languages, runtimes, IDEs, and frameworks to make new and seasoned programmer’s lives simpler. Agile is a method used to help design and deliver software solutions, but there doesn’t seem to be many projects/principals offering a definitive, practical software architecture boilerplate design that programmers can pick up and run with.

Software architecture is something I find of great interest and as I move into a more senior, management role this is where I am keen to leave a legacy for the next programmers.

Would you agree that creating a boilerplate software architecture design that could be downloaded and used within minutes would be of use to the programming community? Utilizing many other seasoned programmer’s experience (not just my own) all into a single design?

It obviously wouldn’t fit all situations, but I think that catering for the 80%ile would be ambitious but possible.

Something that enforced modularity, AOP, and most importantly: good logical separation of tiers and responsibilities out of the box.

Eventually, boilerplates for various languages/frameworks could be made available, freely for programmers to download and start programming in their chosen language within minutes, possibly even a “module store”, providing integration with remote services or the Internet of Things (ITT), enabling separation between integration and implementation logic.

I’d be really interested in hearing your feedback in the comments below.