Telco applications have become so popular to a point, where hundreds of applications are created on a daily basis. With so much of applications being deployed, at least a few apps are bound to have issues, and during the lifetime of an app, various changes and new complications will arise. The ease at which the issues are fixed and debugged will entirely depend on how well the application was planned out and whether best practices were followed or not.
So in the hope of informing developers and saving sometime in future debugging scenarios, let’s go through some best practices that should be followed when it comes to developing Telco Apps.
Directory / File Structure
This is one of the most important things which is often overlooked by developers. Maintaining an organized file structure will help you navigate through your app easily. This also helps speed up development process.
A well planned file structure will have the following attributes.
- A good naming convention for directories and files, ex: defining names based on their function or contents.
- Separate directories for libraries, assets, source-code, and logs.
- No special characters in the directory or file names.
- No redundant directories or files.
A well organized directory structure for a sample PHP based Sms TAP application will look something like this:
This is a key element when it comes to developing applications, in my experience I haven’t seen many TAP applications using version control in their development or production stage. A well maintained repository with proper commit messages and tags can be a very useful tool for developers. The following link provides you a detailed description to effectively use Git, one of the many version control softwares out there right now.
Code Readability and DRY
Being able to read and understand an application without having to spend hours trying figure out which method does what, is considered one of the most important aspects of code review. Such programs will have the below listed attributes that will make development a breeze.
- Includes comments explaining classes and methods.
- White space and blank lines for easy readability.
- Consistent indentation to identify routines and sub routines.
- Consistent naming scheme for variables, camelCase or underscores either of them are fine.
- Limited horizontal length.
And also make sure the code is DRY, which stands for Don’t Repeat Yourself. We write programs and application to make repetitive tasks automated, by repeating code which does the same task, the purpose is lost. So planning the methods are a key to having DRY code.
Logging is one of the key aspects when it comes to developing application its also a simple way of figuring out your applications functions. Like any standard software the basic requirement is to maintain 2 types of log files, activity logs and error logs. But in a TAP application it is better to have separate files for sending and receiving, so it’s much more simpler to search through when needed.
Also generating these logs on a daily basis and clearing older logs beyond a fixed time will help you maintain high performance and minimal disk usage by the application.
Testing is an essential part of any good application development process. Even though there are many aspects to testing applications, the developer should always make sure the do function testing. This test method is useful when code alteration happens very often during the development process.
However most of the time once a functionality is built, unless a direct fault appears as a result of that functionality it is not tested again most often. So running iterative functionality test will help improve application reliability and stability in the long term.
The last piece of the puzzle is deployment. When it comes to deployment some developer make these 2 mistakes.
- Not managing their resources
- Making necessary changes based on hosting server updates
These 2 mistakes can cause the application to fail ultimately and at times become a problem for the applications of other developers if the apps are hosted on shared hosting space.
To avoid make sure the apps have built in mechanisms to manage resources.
One such example is logs files, TAP applications are bound to large logs files, when a log file becomes too large every time an entry is added it will use up a large amount of memory. Now imagine you are sending 100 MT messages, which will result in the log file being written 100 times which will be burden on the server. The situation is even worse when more than one application does this. To circumvent the issue the standard practice is to create weekly, daily or hourly logs based on the traffic.
The other issue is system updates not being reflected on the application. When an application uses shared hosting, the server will undergo updates during its life to prevent security threats and make new technologies available. Not updating the applications to reflect the new updates will either decrease performance or break the app. It is a good practice to monitor the application during active production.
So I hope, these points will be useful in developing future TAP applications.