I've been working on a web service that I've been building in Spring Boot, however one issue I've come across is that when Spring Boot comes across a problem, the structure of the JSON response it generates doesn't match the structure of errors I'm generating in endpoints. The problem with this is that the clients of the service are required to interpret multiple error response structures, which really is unnecessary. The structure of a default error generated by Spring Boot might look something like this; { "timestamp": 1507556642643, "status": 400, "error": "Bad ...

Read More

In this article we’ll briefly look at the strategy pattern, its benefits and how to apply it to a system design. The strategy pattern is classed as a behaviour pattern, it allows behaviours of a class to be changed at run time. To illustrate how to apply the strategy pattern, we’ll start with a simple class diagram which describes relationships between objects in a make believe system. Vehicle - an abstract class which details the properties and operations that child classes will inherit from it. The abstract class cannot be instantiated directly, only via a child class Car, Van, Bus - these are concrete ...

Read More

We’ll start by first asking the question “What is a design pattern?”. A design pattern is a kind of template that describes how to solve a problem, it can be used in many different situations and is used to solve common problems that occur in software design. I’ll attempt to put that definition into some context. Imagine you’re a kitchen designer and you design kitchens for restaurants. Years of experience may have taught you that in a professional kitchen, certain appliances are best positioned in certain places, pots and pans near stoves and ovens, or chopping boards near the sink. Every ...

Read More

A nice short post today. I'm building an API Blueprint for a project I'm working on. If you don't know what API blueprint is I would suggest you checkout the API Blueprint website. I would also recommend checking out a post by Phil Sturgeon on API  Blueprint, as it's what got me interested in using it and was helpful in helping me get to grips with it, see the post HTTP Documentation with API Blueprint. In the past I've been writing my own API documents, hard coded with all the styling. They look great and are easy to understand, but from ...

Read More

When you're working on a project, it's not unusual for a developer to make regularly changes to your layouts and views. The problem I've found with Laravel is it creates a cache of both views and layouts merged as one PHP file, although great for production sites, not so great in development. When you make a change to a view or layout, upload it to your server you may find that you don't see your changes, forcing you to log into FTP and clear the cache from the folder /storage/framework/views. Although this solution works, it's both time consuming and annoying. There ...

Read More

  • PHP
  • 0 Comments

In a project recently I needed to use the filesystem features that you get in Laravel, but in the Lumen framework instead. I couldn't find a clear tutorial online to tell you have to do this, however after some research got it working using the following instructions. First, we need to include some packages using composer; in my case I was going to be using Amazon S3 storage, so I included that.  composer require league/flysystem After installing the league/flysystem package, you'll see a list of additional packages which it recommends you install for things such as Amazon S3, FTP etc. Install the additional ...

Read More

Occassionally a client doesn't understand how complex web application development can be. What they believe is an easy application, or a simply addon can sometimes take much longer than the client anticipates. How do you get them to understand that there's a lot of finer details that need to be taken care of? I came across this answer on Quora earlier today that I thought was great way to explain; Ask your client them to explain in detail how to make a cup of coffee. After rolling their eyes their answer will probably go something like this: Pour water in the carafe Put a filter ...

Read More

Hosting, what is it? why do you need it? what are the different types of hosting and which is best suited to your project? Hopefully in this article I’ll answer those questions. What is hosting? Think of hosting like a drawer in a filing cabinet that’s shared with everyone in the world. You put your documents in the filing cabinet and everyone can easily access them. If you’re building a website, you need somewhere to put your website files so that they can be accessed by everyone. This is where hosting comes in. Hosting is a computer that acts like a filing cabinet, ...

Read More

  • PHP
  • 0 Comments

Wordpress, it’s like Marmite, you either love it or you hate it. If you’re a PHP developer that’s clued up on modern development techniques, you probably hate it. Clients on the other hand, constantly keep asking for their projects to be built in Wordpress… why is that? The perception that it’s cheap Wordpress is free! I mean, come on, why on earth would you pay for a content management system if you can get one that does what it says on the tin… for the total cost of zero?  Wordpress itself is free, but sadly a developers time is not. If your client ...

Read More

SIGNUP TO THE NEWSLETTER

Get useful tips on web application development and software engineering.