Command Handlers

The command pattern is one of the patterns defined in the gang of four's behavioural patterns but I rarely see it get much use. The idea behind the pattern is to encapsulate all of the information required to execute an action within a single object or class: public interface ICommand { void Execute(); } public class AdmitPatient : ICommand { string firstname; string surname; public AdmitPatient(string firstname, string surname) { this.firstname = firstname; this.surname = surname; } public void Execute() { // do something here } } Now the reason I want to highlight this pattern is because of something I've been seeing in a lot software projects. That's…

Read More

JavaScript can double your codebase so make sure you need it first

There's been a JavaScript/SPA revolution in the past couple of years. Its now back in fashion and a lot of people are using it. I'm here to tell you it might not be worth it and that you should stick to server side code. I use JavaScript everyday. Our main application is a SPA (kind of) and it works well. However, it did take a long time to write and our codebase is a lot bigger and more complicated because of it. It's made me realise that you should think very carefully before jumping on the bandwagon. However, there…

Read More