Design Patterns

Recently I’ve started posting a small series of OO related articles, they cover the APIE concepts and the SOLID principles, if you haven’t read these yet, I strongly suggest you do. Once you’ve got an understanding of how to write maintainable and extensible code, the next step is learn how to solve common programming problems using design patterns.

Design patterns have been around for decades, they were first defined properly by the Gang of Four (GoF). Since being defined they haven’t changed that much, in fact many patterns haven’t changed at all. Each pattern is placed into a group, based on what it attempts to achieve. These group are, creational, structural, behavioural and concurrent.

There are also architectural patterns, these are similar to design patterns, but they have a broader scope, taking the entire system into account, where a design pattern is more specific to an area of code.

Continue reading

SOLID Development

Since writing this article, I have rewritten it in much more detail.

In my last article I posted about “What is APIE?“, if you haven’t read this yet and don’t know what APIE is, I recommend reading that article first.

Just like APIE states the 4 basic concepts of OOP, SOLID defines 5 OOP principles which you should always follow when writing code. The letters stand for Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion. As much as all of these principles help in achieving a maintainable code base, the Open-closed and Interface segregation principles aren’t as useful as the others in my opinion as they’re harder to implement effectively and sometimes don’t give much benefit. Regardless I will explain what you need to know about each of these.

Continue reading

What is APIE?

Since writing this article, I have rewritten it in much more detail.

If you have any experience with Object Orientated Programming (OOP), you’ll of probably heard of APIE. If you haven’t, then quite simply APIE is an acronym for the 4 most important concepts of OOP.

APIE stands for Abstraction, Polymorphism, Inheritance and Encapsulation. Each of these are huge subjects in their own right and together form what is know as OOP. Below I aim to explain the basis to each of these concepts, focusing on what they mean, when they should and shouldn’t be used and how you should go about writing code, with them in mind.

Continue reading

Master MySQL Joins

MySQL is such a mistreated language. It’s almost as if all we want to do is SELECT INSERT and UPDATE stuff. Ok thats what we want to do 99% of the time, but that other 1%, you can do some pretty cool things with (If you’re a geek).

Now I bet you was hoping I would teach you how to fight aliens with MySQL, but instead I’m going to talk about joins. Joins sure as hell aren’t amazing, or revolutionary, but I bet, whether you are a newbie or a seasoned pro, there will be something you can learn from this article.

Continue reading