Skip to content

Instantly share code, notes, and snippets.

@elstamey
Last active March 21, 2017 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elstamey/0e15365e701057f8cc92 to your computer and use it in GitHub Desktop.
Save elstamey/0e15365e701057f8cc92 to your computer and use it in GitHub Desktop.
Pulling up Your Legacy App by its Bootstraps!

Pulling up Your Legacy App by its Bootstraps!

Your mission, should you choose to accept it, is to support an application built on an older framework. Refactoring isn't an easy option. The code is untested and nowhere near best practices or standards. In this session, we'll talk about strategies to incorporate modern PHP coding practices to add features and functionality and retiring the older code in pieces. We'll review specific examples and code from a real project where we bootstrapped a legacy application that needed a lot of help to become useful to its users and simpler for developers to maintain. We'll talk about strategies to leave the existing code in place until the new code is ready to replace it in whole or in pieces.

@elstamey
Copy link
Author

There are a lot of different types of legacy codebases. Some can be incrementally refactored. Others may need to be replaced one feature at a time. However some legacy applications are too risky to alter. If the application is very important to your organization, what can you do to avoid breaking the application?

We will talk about a Scholarships project my team bootstrapped. We created new models for the application in a directory adjacent to the framework. As these new models were tested and ready, we used dependency injection to include them in new controllers in the old framework. This allowed us to leave the old application intact until we could completely replace it. After we completed replacing the code features, we could take our new classes and use them in a new framework or as a standalone application.

Attendees will learn:

  • common terminology around legacy codebases
  • strategies for assessing the state of the legacy application before deciding how to proceed
  • tools that were crucial to our refactoring project. The specific tools are from the PHP ecosystem, but they are applicable in other legacy environments (testing packages, package manager, database migration tool, and dependency injection container tools)
  • general ideas of how the Events, CQRS, and DDD worked to help us improve our application

@elstamey
Copy link
Author

for tek, shorter:

Your mission is to support an application built on an older framework. Refactoring isn’t easy. The code is untested and not using standards. We’ll talk about how to incorporate modern PHP coding practices to replace code and retiring the older code in pieces. We’ll review examples and code from a project where we bootstrapped a legacy application that needed a lot of work. We’ll talk about strategies to leave the existing code in place until new code is ready to replace it in whole or in pieces.

@elstamey
Copy link
Author

elstamey commented Jan 9, 2017

There are a lot of different types of legacy codebases. Some can be incrementally refactored. Others may need to be replaced one feature at a time. However some legacy applications are too risky to alter. If the application is very important to your organization, what can you do to avoid breaking the application?

We will talk about a Scholarships project my team bootstrapped, a legacy CodeIgniter App. We created new models for the application in a directory adjacent to the framework. As these new models were tested and ready, we used dependency injection to include them in new controllers in the old framework. This allowed us to leave the old application intact until we could completely replace it. After we completed replacing the code features, we could take our new classes and use them in a new framework or as a standalone application.

Attendees will learn:
- common terminology around legacy codebases
- strategies for assessing the state of the legacy application before deciding how to proceed
- tools that were crucial to our refactoring project. The specific tools are from the PHP ecosystem, but they are applicable in other legacy environments (testing packages, package manager, database migration tool, and dependency injection container tools)
- general ideas of how the Events, CQRS, and DDD worked to help us improve our application

This talk is very accessible to a newer programmer because we talk about the tools added to the legacy codebase, and how they were helpful.

I have given this talk at several conferences and local user groups.
Triangle PHP, March 2016
NCSU Campus Developer Group, April 2016
Peers Conference, April 2016
Dayton PHP, May 2016
Open Source Bridge, June 2016
Chapel Hill PHP, Sept 2016
Connect.tech, Oct 2016
Sunshine PHP, Feb 2017

@elstamey
Copy link
Author

Your mission, should you choose to accept it, is to support an application built on an older framework. Refactoring isn't an easy option. The code is untested and nowhere near best practices or standards. And development is happening in production. In this session, we'll talk about strategies to incorporate modern PHP coding practices to add features and functionality and retiring the older code in pieces.

We will talk about a project my team bootstrapped, a legacy CodeIgniter App. We created new models for the application, and we used dependency injection to load them into the old framework. This allowed people to use existing functionality until it could be replaced. We'll review specific examples and a little code from this project. We'll talk about strategies my team used to plan and implement this project. And we'll discuss tools that can modernize your legacy project.

Attendees will learn:

  • common terminology around legacy codebases
  • strategies for assessing the state of the legacy application before deciding how to proceed
  • tools that were crucial to our refactoring project
  • changes to our development workflow
  • the dependency injection needed to incorporate the new tooling and classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment