Sunday, October 24, 2010

How to setup a simple Continues Integration Server for PHP

Ok, finally found some time to finish this article :)

In the previous article I have explained the concepts of Application Life-cycle Management (ALM) and Continues Integration (CI). Here, I'm explaining in detail how to configure a fully working Continues Integration environment using Hudson in Windows.

I wanted to give a complete picture of the CI server configuration within windows and it's obvious that I can't explain this using a single blog post. hence, I have created .PDF file that explains the whole process step by step. You can download this article and keep it with your for future reference as well.

Download the article here.


Continues Integration Server for PHP



Please let me know if this has helped you. If you have any questions, just leave a comment and I'll try to resolve it for you.

I hope this article has been good learning experience for you as much as it has been for me. In the next article I'll be proposing a MVC based application design architecture that will be suitable for many enterprise level application development in PHP. Until next time, Keep blogging :)

Wednesday, August 25, 2010

Properties of a Large Scale Applications and Elements of Application Lifecycle Management

This is the 2nd part of a series of articles written to show how PHP and related technologies can be utilized to create large scale enterprise level software applications. You can read the first part here.

Before we drill down into specifics about this subject, I would like to share few thoughts about the term “Enterprise Software Applications”; I believe this will help us understand the properties of such software application in order to identify the necessary elements in developing them. Simply put, enterprise software applications are complex application software that are used in large scale corporate level (or enterprise level) business entities. These applications enable such large multi facade organizations to operate seamlessly across countries and usually capable of handling both B2B and B2C transactions. These applications are capable of operating in a distributed environment and provide multiple ways for clients or other applications to interact with them (i.e. the same application can have a standalone GUI, a web interface and a set of web services exposing selected functionalities.

With the above simple understanding, we can focus on a more organized list of properties for an average enterprise software application.
  1. Complex in nature. I.e. these applications are complex in all aspects (planning, designing, development, data storage and management, deployment etc…)
  2. Extendable and Scalable, Designed in a way that changes to the functionalities can be done easily and quickly.
  3. Secured, reliable and most importantly interoperable, i.e. the application can work with either existing legacy system or another 3rd party software application.
The list can go on, however, you can find good articles in the internet regarding this subject, hence I’m restraining from going onto explaining the nature of an enterprise level application in grate details (actually that will require another complete article ?). Important thing to understand here is that these applications are large, complex and usually will be used to manage the complete end to end business processors of an organization.

In developing such applications, it’s obvious to see the importance of following a suitable software development process and doing software analysis and designing. A good software design and architecture is essential to complete a project of such magnitude successfully. However, there’s another area that is absolutely imperative for the success of enterprise application development, and that area is the application development environment or to be more precise, the Application Lifecycle Management Environment. Most of the times we don’t tend to think about this factor and it leads to lot of issues or complete failures.

Application Life cycle Management (ALM) environment is essentially a collection of tools that enable one or more development teams to plan, design, code, manage builds, test and deploy enterprise level software applications. It automates most tedious tasks and helps to maintain a high standard in coding and documentation. Most of the times, enterprise level applications are developed by multiple teams and ALM provides an excellent environment for them to coordinate their day today tasks. Having said that, I should point out here that the exact set of tools that go into the ALM environment will depend on the software development process you are following. I am a big fan of Agile based processors (specially Scrum); hence, the environment I have presented here will be more suitable for Agile Scrum based software application development. However, it can easily be adapted to suite other software development processors without much effort.

Structure of a typical ALM is given below.



Major part of any ALM is the Continues Integration (CI) of the application you are building. CI is a very important concept in enterprise application development, this allows multiple teams working on the same application project to seamlessly manage the source code and create successful builds every time a commit happens to the SVN server. CI servers will also take care of checking the code for any coding standard violations, and unit tests and the whole process is completely automated.
If you are coming from J2EE background, chances are that you have worked in an CI environment before. Our target here is to port a similar environment for PHP based application development.

Our next article will focus on configuring a fully fledged CI server for PHP. But first, we need to identify the right set of tools. Normally, A CI environment will be configured within a Linux environment, there are many good articles that explain how to do this, however, most of us who are doing development still use Windows as our development platform. And it’s surprising to see how well the windows environment can be used as a CI server as well. So, I’ll be using Windows to show you how easy and quick it is to configure fully fledged CI environment. I’m using the following tools and environments
  1. Windows XP /Windows Vista/ Windows 7/ Any Windows Server version
  2. XAMPP (http://xampp.org/)
  3. Subversion (for Version controlling, server and client)
  4. Hudson (Continues Integration and Build Management)
  5. PHPDoc (http://manual.phpdoc.org/HTMLSmartyConverter/HandS/li_phpDocumentor.html)
  6. PHP Code Sniffer - PHPCF (http://pear.php.net/package/PHP_CodeSniffer/download/All)
  7. PHPDepend (Code Analyzer) (http://www.pdepend.org/documentation/getting-started.html)
  8. PHPUnit - Unit and Integration Testing (http://www.phpunit.de/manual/3.4/en/installation.html)
  9. XDebug – PHP Debugging tools

I’ll use the above tools and few others to configure our CI server in the next article, so stay tuned

Friday, August 20, 2010

Introduction Enterprise Application Development in PHP

In all my years of PHP Application development, one of the major questions I faced is how to properly plan out, develop and manage a large scale PHP based application projects. There was a time not so long ago that evens the idea of using a “scripting” language such as PHP to build large scale applications was only a dream. However, I believe PHP has matured enough now to be used in real life large scale application projects. However, most of us who has used PHP for the past 5 years know that PHP is still largely a functional or procedural programming language. However ability to code in 100% solid Object Oriented concepts is a must if you want to succeed in any large scale application. So, the question of how to properly use PHP to use large scale applications is still largely an open question.

My intension here is to share my own experience with you and to share my views on enterprise level application development in PHP. This is the first of a series of articles that are targeted to provide a wide coverage on this subject. An overview of what will be covered in this series is given below

1. Introduction to Enterprise application development in PHP (This one)
2. Elements and Properties of an large scale application and Application Lifecycle Management
3. How to setup a simple Continues Integration Server for PHP which is one of the major part of ALM
4. Tips to a successful PHP based application design architecture
5. Retrospect

I’m trying to make this a comprehensive learning experience as much as possible. Hence, I’ll be posting real code and command segments on the article. However, please keep in mind that this might NOT be the only or the Best we to develop enterprise applications in PHP, but, it’s another method and a method that has worked for me.

Is PHP enterprise ready? I’ve heard many people ask this question. And truly I believe it is. When it comes to enterprise application development you might think why do we use PHP to develop enterprise level applications? I want to ask you Why NOT? PHP is flexible, scalable, fast ,supports both procedural and Object Oriented programming, has a rich set of inbuilt functions, open source, excellent community support, easy to learn, supported by many high level development tools and IDE’s, and, backed by worlds most renowned web server Apache. So, I think we need to step out of the shell that we stayed for the past 5 or so year, PHP has come a long way since being a simple scripting language and it’s now time to harness its full power and make it a strong competitor in the enterprise level application development arena.

Having said that PHP is not without its cons, one of the biggest draw backs I see in PHP is that it doesn’t have a single governing body to govern and monitor the maturing process of the language. I believe this is evident if we consider the number of frameworks that are available for PHP based programming. PHP doesn’t have a OOP based or MVC based inbuilt API, at its core it’s still largely a functional or procedural language and hence its API is a functional one. This has opened a vacuum that has been filled by numerous none standardized OOP and MVC based frameworks. I think it’s excellent to have so many frameworks; however, the problem is that they don’t honor a common standard. I believe PHP will be a much better platform if PHP’s governing body standardized the OOP and MVC framework structures so people can use them without having to worry about learning a new frame work from scratch from vendor to vendor.

I will not justify or deny the use of PHP in enterprise application further more. If you have read this article up to now, that means you have already decided to use PHP and I’ll take it from there.

Surprisingly, in order to follow this series you don’t have to have a in-depth knowledge in PHP (however, you should have expertise on at least one programming language). The complete Continues Integration (CI) environment will be setup under Windows, although I’m providing you the set of commands, you are required to have a basic understanding on Windows commands and .bat files in order to use them effectively. That’s all we need and we are ready to go.

So keep my blog bookmarked, I’ll be posting the part 2 of this series soon.

Friday, July 2, 2010

Knowledge, IT guys greatest strength/asset?

Whenever I sit in an interview board, one of the most common questions I have heard is “What do you consider your greatest strength or asset?” and almost everybody has answered “Knowledge”. Just last week I was mentoring few interns in my office and I asked them to write what they expected to gather during their internship period and, yes, you guessed it, all of them said that they want to gather knowledge of specific technologies such as JAVA, .NET etc…

So, is it true? is knowledge our greatest strength as IT professionals? In my view this is far from true when it comes to an IT Professional. IT is one of the most volatile disciplines (if not the most) in the world, technologies changes over night, inventions are made hourly (not yearly) and what you know will become obsolete in a blink of an eye. Hence, if what I know will become useless in a matter of months then how can what I know be my greatest strength? The truth is what I know is ALWAYS less than what I don’t know or what I SHOULD know.
What should be my greatest strength then? What should an intern gather during their intern ship in a professional corporate environment? The answer is “learning to survive”; every IT guy must know how to survive in this industry. What do I mean by that? Being an IT guy is just like being Tarzan in the jungle, environment always changes and will always challenge your existence, knowing how to adapt to these changes quickly and addressing the problem at hand is the key to success in this field (that’s how Tarzan survive ). I believe in order to be successful in this industry you must have 3 things. If interns learn to master these 3 things during their internship period I think they will do grate as IT professionals once they graduate. The key 3 qualities are as follows

1. Self Confidence
2. Interest
3. Drive or Will to succeed

If you posses these 3 qualities you can learn any technology, adapt to any environment and handle any challenge this industry can through at you.

Self Confidence is all about BELIEVE you can (not knowing you can). Whenever you are faced with a problem or a challenge, first you should have the “can do” attitude. It will only come if you believe you can. This is the first step to overcome any challenge.

In anything you do, if you want to succeed you must have an interest to do it. Without interest you can’t keep the momentum going. However, we all have our different interests but in my experience if you keep on working on even something you don’t like, you’ll start developing an interest towards it.
Drive or will to succeed is very important because you are bound to fail initially, you must have the drive or will to try and try again.

So, in essence I believe what every one of us should be after is not knowledge but we should learn how to survive in the industry and we should build confidence, interest and drive within us and make them our greatest asset and strength.