I have a system that is completely procedural in style, and I want to know what points I need to identify in order to turn this code into an object-oriented one.
I have a system that is completely procedural in style, and I want to know what points I need to identify in order to turn this code into an object-oriented one.
I had this procedure on a site that I developed when PHP
did not have POO
yet. The big problem is understanding the current business rule and translating Object Oriented Programming. They are different things, and their main goal is to understand Procedural and Analyze before implementing OOP.
Tip:
1) What does your system do?
Example: Make a customer registration, how you can reuse something, maybe the View and some code, but in real terms, the part code will have to be rewritten, it's a big job.
2) Can I reuse code?
Example: The SQL
you can take advantage of, I believe they are the same or practically the same. You will now have to use PDO
or MySqli
, then start the changes there.
3) Is it worth changing or making another?
Often it is better to design in POO a new system that can be done in parallel to the old one, thus avoiding system shutdown, and emphasizing the new system.
4) Working with Standards?
I suggest working with current patterns and nomenclatures, interfaces , abstract , class . An important factor is knowing POO well, and maybe even implementing it with MVC Frameworks, eg Laravel or Zend (Laravel indicates faster learning, Zend learning curve is higher)
5) Procedural Code for OOP Code, care?
Beware, as it has been reported POO is concept, follow the OOP concepts and make a new code with such concept. Experience: once I worked on a team that had programming in Cobol and they started to make a system in VB6, what happened, everything they did in Cobol they replicated in VB6, that was the worst absurdity I've ever seen. p>
I participated in a project recently where I had to carry a desktop system programmed in VB6 for ASP.NET C # OO (3 layers).
My review was as follows:
As OO is a concept I believe my experience can help you