Working with legacy systems

A couple of months ago I met a client who wanted to extend his legacy system. It’s a school ERP system based on OpenSys, but super old. My client was happy with his existing system performance and stability, so he just needs to extend it to next level. Adding a library system, altering the payment mechanism, way to track student sports activities, and send/receive data from back office accounting system. Those are some of his requirements.

I never worked with Opensys or any other School ERP before. But it’s written in PHP which is my most comfortable server side language so I took the project. My client then gave me an instance of his application. The first thing I noticed is the system coded in the structured method using raw PHP. Yeah, you heard correct no framework, no OO or MVC just tons of code lines written in the structured method. And do you know the best thing? No sophisticated commenting :O, so it’s obvious I need to read and understand codes before doing any changes. But the system is compatible with PHP newer versions. Someone must have updated the system while keeping the original architecture.

It’s a challenge, but hey I love challenges. What is the fun in coding if we do the same thing each and every day?  I started to read the codes and tried to understand it. Then I realized the system is based on some sort of framework. It seems the original author(s) created a collection of classes and libraries to aid the system development. There are existing functions to create input fields, run database queries, create dialog boxes and os on.  Another good thing is system based on installed modules. Basically, we can create a new module and install it to add new functionalities.

I forgot to mention that the database is Postgresql. Postgresql is also new to me. I didn’t have many experiences with it before. Anyway, I started. I was very careful to keep the same look and feel in the user interface. But I added several jquery based plugins.  Also commented each and everything I have done for future use.

There are some issues also to be addressed in existing modules as well. For example, every month ends in 31st. Don’t laugh at me. I’m telling the truth. Calendar control generated from library function so I altered the code to use jquery calendar control. Some part of the existing code is brilliant and some parts are very silly. So I think It developed by several developers. So anyway, after a couple of months each and every module completed. Then new challenge has come.

Did you remember I told about a back office accounting software? School ERP needs to get some data from it and send some data to it as well. The accounting package is very old and it is written in Visual Basic. It’s a very old custom build accounting system but believes me, it’s very stable. Accounting package uses Microsoft SQL server as the database. The developer who developed accounting package told me it’s very difficult to create a web service using Visual Basic.

Now I have to pull and push data directly to  Microsoft SQL Server database using PHP. After a little trouble, I was able to communicate between my PHP application and the SQL server.

After all, this completed the customer brings a new requirement. He needed a KPI dashboard. If you aren’t familiar with the word KPI, it means “Key Performance Indicators”.  In short, It’s an application with lot’s of graphs and charts and allow the organization to set their strategies and goals by analyzing organizational data. Also, the client requested it as a separate application which shares same user credentials.

I used F3 PHP (Fat-Free PHP) a minimalistic PHP framework for the KPI backend and Gentelella bootstrap 3 admin template for the KPI UI. Genetelella well equipped with almost all elements needs for a dashboard but I used Google chart API for charts instead. For user authentication, I used a token based authentication method. So If the user is logged into school ERP and navigates to KPI dashboard he/she automatically logged in if they have privileges. They will redirect back to ERP login page if they aren’t logged in already.

The project is almost over and I’m doing final tweaks and touch ups now. It will be online in particular school premises within a couple of weeks. What I wanted to say about this experience is, most people don’t like to work with legacy systems (I was in the same boat before) but there are lots of things we can learn from them. As a web developer always learning is a Must fact if you want to be a good developer. There is always a way, at least work around even if how complex or how badly the system is developed.

Happy new year to all of you.


2 Comment(s)

    1. Reply

      Admire your personality and your new challenges to accept!
      Perhaps this is what you should do, no choice, maybe it is not wise!

      1. Reply

        Well, thank you very much… 🙂

Leave a Reply