The Right Approach to Developing Software

Home » Advice for New Developers » Software Architecture and Design » The Right Approach to Developing Software
Photograph of engineers tools

I have not blogged for some time due to pressure of work, instead I tend to record ideas for blog posts on my kanban backlog… and they just add up.

Anyway, this post covers a couple of points highlighting different approaches to developing software which I have noted while working in the industry.

Code First or Database First?

I’m not talking about the Entity Framework methods of creating data models / databases here.

Is there more code in your system than there needs to be and / or is it more complex than it needs to be? This is subjective of course, but if so it is a major indicator that your database model / designs could be improved. A consequence of improving these designs is that the code becomes trivial. The purpose of any system is to translate the data model into concepts that make sense to the user. If the data model is designed with user requirements in mind, then the task becomes far simpler.

I remember 20 years ago a system I worked on which was for contract management for a big UK company.. This involved a major modification to an existing system. But management had decreed that there would be no contract table in the database….

System Requirements First or User Requirements First?

When making a change, say user A asks us to add a feature to system B, then there are two ways of approaching it.

  1. We could look at system B and work out which pages, methods etc. need to be changed, to allow for the easiest possible change with minimum changes.
  2. We could look at the design, the concepts of system B if you like from the users perspective and give them something that fits the requirement really well while putting the actual changes needed to the system second.

Many developers, especially the less experienced, when under time pressure are much more likely to think about the former approach and not care / understand too much about where the user is really coming from and what their needs are. The best systems often fill a strategic need for the user in a really elegant way, and these are often the result of the second approach.

Often the result of using the first approach (i.e. minimum changes) is to end up with a slow, complicated unmaintainable mess that doesn’t work properly. In other words the first approach is not always the best approach. Just because you can change something a given way doesn’t mean that you should. The first approach doesn’t always result in a shorter development time either, esp. not when you include the time for support.

So just because you can change a system in a given way, doesn’t mean that you should.

Other Indicators

  1. If you are copying and pasting code, stop and think why?
  2. If you are adding data access code in a code behind or a MVC controller, stop right there. Whats stopping you creating a class library and moving the data access code at least into it?
    Or much better, make a service class library and reduce your controller / code behind code to just a couple of lines. Your code will immediatley start to improve. I don’t care how you then structure your class library, the fact that you have split UI and business / data layers is a major, major win.
  3. If you have methods that are pages and pages long, either you are coding them wrong, or your database design is wrong, or both.
  4. Have you got response times longer than 2s on your internal network (WAN access to webservices might be beyond your control)? If so then it may be you are adding everything into a smaller number of views and tables than you should (yes some companies still use Views and Stored Procedures… its ok in my book depending on the circumstance).

Conclusion

There are a couple of things I’m thinking about at the moment:-

  1. How best to layer software, e.g. user interface (MVC, MVVM), service layer, business logic, data layer, helpers, that kind of thing.
  2. How best to link different systems together. The old way of using contractors to weld systems together the so called “Best of Breed” approach, falls over when a new version of a system is required. I have refused these kind of contracts for the past ten years or more. The modern way to approaching these kind of integration tasks is to define the interfaces between different systems and using message queing (NServiceBus or RabbitMQ) to handle the interfaces. This has the additional benefit of allowing each system’s individual database design to be under control of the system developers and be changed to meet the needs of that system.

I hope to blog more about this in the future, time allowing.

Happy Coding!

About Phil

I have been working as a software developer since 1983. This blog could have been called "From Fortran 77, C and Cobol to C# in 20 (not so) easy years", but it doesn't sound quite right somehow. Besides I'm talking about what's happened since 2003, not before!

Leave a Reply

Your email address will not be published.


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>




Top Posts & Pages

Categories

Recent Posts

Recent Comments

Archives

Blogroll

  • Mike Cohn's Blog
  • Scott Hanselman's Blog
Be a Great Product Owner: Six Things Teams and Scrum Masters Need

Learn six ways effective product owners ensure their teams’ success. [...]

What Happens When During a Sprint

Succeeding with Scrum is easier when you know when and why to conduct each of the Scrum events during the sprint. [...]

What Are Agile Story Points?

Story points are perhaps the most misunderstood topic in agile. Story points are not based on just one factor--such as complexity, as is often mistakenly claimed. Instead, story points are based on a combination of factors. [...]

Don’t Equate Story Points to Hours

I’ve been quite adamant lately that story points are about time, specifically effort. But that does not mean you should say something like, “One story point = eight hours.” Doing this obviates the main reason to use story points in the... [...]

Epics, Features and User Stories

I've been getting more and more emails lately from people confused about the difference between "user stories", "epics" and "features." So I thought this month we'd return and cover some basic--but very helpful--territory by explaining those terms. First, the terms don't matter that much. These are not terms with important specific meanings like "pointer" to a programmer or "collateralized debt obligation" to whomever it is that's important. [...]

- Scott Hanselman
Use your own user @ domain for Mastodon discoverability with the WebFinger Protocol without hosting a server

Mastodon is a free, open-source social networking service that is decentralized and distributed. It was created in 2016 as an alternative to centralized social media platforms such as Twitter and Facebook. One of the key features of Mastodon is the use of the WebFinger protocol, which allows users to discover and access information about other users on the Mastodon network. WebFinger is a simple HTTP-based protocol that enables a user to discover information about other users or resources on the internet by using their email address or other identifying information. The WebFinger protocol is important for Mastodon because it enables… [...]

- Scott Hanselman
I got tired

I have been blogging here for the last 20 years. Every Tuesday and Thursday, quite consistently, for two decades. But last year, without planning it, I got tired and stopped. Not sure why. It didn't correspond with any life events. Nothing interesting or notable happened. I just stopped. I did find joy on TikTok and amassed a small group of like-minded followers there. I enjoy my YouTube as well, and my weekly podcast is going strong with nearly 900 (!) episodes of interviews with cool people. I've also recently started posting on Mastodon (a fediverse (federated universe)) Twitter alternative that… [...]

- Scott Hanselman
Using Home Assistant to integrate a Unifi Protect G4 Doorbell and Amazon Alexa to announce visitors

I am not a Home Assistant expert, but it's clearly a massive and powerful ecosystem. I've interviewed the creator of Home Assistant on my podcast and I encourage you to check out that chat. Home Assistant can quickly become a hobby that overwhelms you. Every object (entity) in your house that is even remotely connected can become programmable. Everything. Even people! You can declare that any name:value pair that (for example) your phone can expose can be consumable by Home Assistant. Questions like "is Scott home" or "what's Scott's phone battery" can be associated with Scott the Entity in the… [...]

- Scott Hanselman
JavaScript and TypeScript Projects with React, Angular, or Vue in Visual Studio 2022 with or without .NET

I was reading Gabby's blog post about the new TypeScript/JavaScript project experience in Visual Studio 2022. You should read the docs on JavaScript and TypeScript in Visual Studio 2022. If you're used to ASP.NET apps when you think about apps that are JavaScript heavy, "front end apps" or TypeScript focused, it can be confusing as to "where does .NET fit in?" You need to consider the responsibilities of your various projects or subsystems and the multiple totally valid ways you can build a web site or web app. Let's consider just a few: An ASP.NET Web app that renders HTML… [...]

- Scott Hanselman
A Nightscout Segment for OhMyPosh shows my realtime Blood Sugar readings in my Git Prompt

I've talked about how I love a nice pretty prompt in my Windows Terminal and made videos showing in detail how to do it. I've also worked with my buddy TooTallNate to put my real-time blood sugar into a bash or PowerShell prompt, but this was back in 2017. Now that I'm "Team OhMyPosh" I have been meaning to write a Nightscout "segment" for my prompt. Nightscout is an open source self-hosted (there are commercial hosts also like T1Pal) website and API for remote display of real-time and near-real-time glucose readings for Diabetics like myself. Since my body has an… [...]

Meta