Category Archives: Software Design

HOWTO: Design good Domain model

Designing domain models is probably the first thing that every software developer learns in school.

The concept for good domain model is quite simple: diagram representing the business objects (entities) in a system and the relations among them.

The purpose of the domain model is to create a common language, terminology and understanding for the system and the business around it.

Even though it might be a simple and well-known definition it somehow seems to be also quite tricky and hard to follow through.

Continue reading HOWTO: Design good Domain model

Kayako PHP API library for Kayako Fusion RESTful API

kayako php api

I personally found the official  Kayako PHP API library 1.1.0 for Kayako Forge quite disappointing. It reminded really on the auto-generated SOAP connectors in Java with the only difference that since it is REST web service there is no way to be sure that the library version that you have will match the one on your Kayako installation.

The official Kayako PHP API quite reminded my on the auto-generated SOAP, with the only difference that the Kayako one isn’t auto-generated.

Some background on auto-generated connectors. They are generated based on the SOAP WSDL descriptors and therefore they are normally slightly large, complicated and messy.  The positive part in them is the reassurance that the connector is going to work with exactly that web service structure that you have installed.

In REST services unfortunately there are no descriptors so it is not possible for you to generated something based on your web service structure.

I find the official Kayako PHP API library poorly designed, because:

  • There are thousands of classes and nestings throughout the library.

That makes the easy web service functionality to look extremely complicated, confusing and uncompromisable.

  • The library constantly throws E_STRICT exceptions due mismatch between the abstract Base class constructors and the classes extended from them.

Normally when one makes library all exceptions should be accepted, because you don’t know what are the error settings of the systems which this library will be integrated in.

  • There are too many specific static variables in the different classes which are hard-coded to the actual web service values.

I found that not only confusing but also a potential for a lot of problems.

The Kayako PHP API solution that I used


After spending the better part of the day in different ways to making that delicious treat to work I just decided to make a really light Kayako PHP API library on my own.

Git repository –

This Kayako PHP API library is built with the same design used in the official Mandrill PHP library. It aims to spare you redeclaring all keys and HTTP related setting.

If you want to read more about the Kayako Fusion RESTful API and the official Kayako PHP API, here is the documentation: