Home » Archive by category "Software Architecture"

Reasons Software Architecture Matters

Several weeks ago, I was talking to a programmer and we got into a discussion about the importance of software architecture.  I maintained that having a defined architecture is important regardless of the team size, the person I was talking to asserted that architecture wasn’t necessary when there was just one person involved.

But here’s the thing.  All software has an architecture.  Even the most junior of programmers has an idea of how code should fit together.  At issue isn’t really about architecture.  It is about having a defined architecture, based on experience and best practices, that will allow the team to develop the software in question as efficiently as possible.  Software architecture, at its core, says, “this is how we build software.”

To find the reasons why software architecture matters, it is helpful to think about what happens when there isn’t any defined architecture in place.  For the purposes of this article, I’m going to generalize on how architecture impacts teams and where appropriate show why that is also important when your team is just you.

Reasons Software Architecture Matters
Photo via VisualHunt

Continue reading “Reasons Software Architecture Matters”

4 Reasons to Write Loosely Coupled Code

This past week I got into a small discussion about the importance of loosely coupled code.  Specifically, I was looking at event handler code that did nothing more than change the size of another element on the screen.  But the event handler code was in the controller which in the particular implementation we are using was the event handler portion of our Model in a MVVM architecture.  The question becomes does this code belong in the view, or does it belong in the controller?

The question of where code belongs leads eventually to arguments for loosely coupled code.  If I put code in my controller that is manipulating the view, then I either need to mock out my view in order to test my controller or I have to have an instance of my view available to test my controller.  Having coded enough systems to know that both of those choices are problematic, I opt for placing the view specific code in the view.  Another place where you might place this code would be in a View Specific event handler class.  But that would only be for the purposes of clean separation.  Something we might consider doing if the View were plain HTML.  But in our particular case, the view is generated from code, so placing the handlers in that same code seems to be the most appropriate location for it.

But all of this leads to a larger question.  Why should your code be loosely coupled at all?

4 Reasons to Write Loosely Coupled Code
Photo credit: Hernan Piñera via VisualHunt.com / CC BY-SA

Continue reading “4 Reasons to Write Loosely Coupled Code”

Are You Thinking Clearly About Your Architectural Choices?

Recently someone asked me where the business rules should go in an MVC framework.  The Model or the Controller?

This reminded me of a post I wrote when ASP.NET MVC was first released.

But today I want to cover a broader topic common to everyone, not just programmers.  Not being able to think outside the box.

image

Continue reading “Are You Thinking Clearly About Your Architectural Choices?”

Why Is It Called “Inversion of Control”?

CHIL0007There is a guy I’m working with who is trying to wrap his head around design principles.  He’s been watching a lot of PluralSight videos.  As he was processing information about Inversion of Control, he asked the natural question I’ve never actually considered before.  “Why is it called Inversion of Control?  Normally, when you talk about ‘Inversion’ you are talking about reversing something or negating something.  That isn’t what we are doing here.”

Continue reading “Why Is It Called “Inversion of Control”?”

Software Architecture without Test Driven Development is DANGEROUS!

TDD Impacts Software ArchitectureI’ve had two incidents recently that have shown me how TDD impacts Software Architecture.  Both of these are with code I’m working on.

What Software Architecture Might Do

Software architecture might specify how is put together at a very high level.  For example, software architecture might specify that we use a three tiered approach or an n-tiered approach.  This approach places our view code is at one level, our business rules are at another level, and our data access at yet a third level.

Continue reading “Software Architecture without Test Driven Development is DANGEROUS!”