31
votes
Accepted
What are the best practices around retiring obsolete database columns?
If you want to keep the data, then it's not obsolete. Just leave it where it is. It's fine if some class mapped to a table doesn't map every column.
30
votes
Is Poor Man's Dependency Injection a good way to introduce testability to a legacy application?
The critique about Poor Man's Injection in NerdDinner has less to do with whether or not you use a DI Container than it does about setting up your classes correctly.
In the article, they state that ...
25
votes
Is Poor Man's Dependency Injection a good way to introduce testability to a legacy application?
You make a false assumption here over what "poor man's DI" is.
Creating a class that has a "shortcut" constructor that still creates coupling is not poor man's DI.
Not using a container, and ...
22
votes
Accepted
Is it an anti-pattern to create ORM entities based on existing database schema?
Reverse engineering was created for precisely your kind of situation. It was meant to be a time-saving tool when using an ORM with an existing database. The tool can do in a few minutes what a human (...
12
votes
How to modernize large legacy Fortran program?
OK in all seriousness, this code has worked for 30 years. It will work for 30 more.
You could spend your life 'modernising' it and only add bugs.
Start walling bits off and componentising so you can ...
12
votes
Accepted
Introducing TDD in a legacy product
TDD does not really apply to maintenance. Instead, Test Driven Development is an iterative model that focusses on the development or implementation phase. Normally, the software life cycle would first ...
10
votes
What issues lead people to use Japanese-specific encodings rather than Unicode?
These are the reasons that I remember were given for not making UTF-8 or another Unicode representation the default character encoding for the scripting language Ruby, which is mainly developed in ...
9
votes
Accepted
How do you assess the damage in a system that has been using floats or doubles for money?
Using single precision float for money is fatal. Float has only 24 bits of precision, so if you are using dollars, then anything above 2^18 dollars has a resolution worse than one cent. So anything ...
9
votes
Accepted
How do I write unit tests for legacy code (that I don't understand)?
To a first approximation, the stakeholders of a test suite are the code developers/maintainers. You're going to need some of their time. Insist on this.
Ask them about problems they're facing.
Ask ...
9
votes
Is stateless mode necessary before containerizing a monolithic application?
You seem to have most of the answers in your question.
The short answer to your question is "containerized application can be statefull". On the same note "You will not get many of the benefits of ...
9
votes
Rebuilding a legacy application : What about the data model?
Think big, start small.
The most effective way I know for tackling the described situation is the following approach:
Scetch your "vision" of the full data model, but do not implement it ...
8
votes
What are the best practices around retiring obsolete database columns?
OK so your situation is that you want the old rows to have property C but the new ones not.
This is equivalent to having a class inheritance relationship
class All
{
string A;
string B;
}
...
7
votes
New frontend for legacy code
From my experience you should NEVER try to recode something existing if it does not have good specifications and test.
Trying too create a new app always seems good at first glance (working with new ...
6
votes
Is it an anti-pattern to create ORM entities based on existing database schema?
Both patterns are supported. Code first versus Model first. If you have an opiniated database administrator(s) or strong SQL skills one may choose Model first. If one has less SQL expertise, ...
5
votes
Accepted
Should I Microkernel or Microservice my legacy ERP?
There are certainly similarities between a plugin architecture and a service architecture. Both approaches can be used to modularize an application. But there are fundamental differences:
With a ...
5
votes
Accepted
With source code lost, can the binary be released as MIT without it?
In every jurisdiction I know, the author or copyright holder of a software can pick whatever license they like, source code available or not. And nowhere in the MIT license does the term "source code" ...
5
votes
How to approach this legacy Java project?
Do not refactor.
"done the right way" is just ass covering and not yours!
Get clear requirements and implement them with the minimum number of code changes.
Get sign off that the app works and the ...
5
votes
Accepted
Wrapping a legacy project in a test framework
You've got the basic pattern. Define interfaces for the classes that communicate with out-of-process resources, like databases and file systems. Then have the "real" class implement the interface. ...
5
votes
Use old legacy application code from new application
Surface Area
The problem is that any change now requires consulting two or more "separate" code bases using different styles, conventions, frameworks, and perhaps even languages, paradigms, ...
4
votes
Designing new system to replace legacy: Would you start with a new database and maintain both independently until the switch?
I would have both systems running concurrently. Gradually migrating users/customers off the old one onto the new one.
The benefit of this is that you can test the new system with a subset of ...
4
votes
Introducing TDD in a legacy product
Allocate resources to writing tests for old code and refactoring the untestable bits. This is going to be a very slow and gradual process, but that's going to be slow no matter what you do since you ...
4
votes
Accepted
How to convert multiple Git repositories for related code into proper branches/tags
Since these individual repositories were copied from the original, you can re-establish the relationship between the copies and the original. See this other answer for more details.
Use git remote ...
4
votes
Is it an anti-pattern to create ORM entities based on existing database schema?
Neither is an anti pattern, they are just two different mindsets regarding database integration:
The application centric: The database is just a service for persisting application state. The role of ...
4
votes
Is it an anti-pattern to create ORM entities based on existing database schema?
Who "owns" the database? Is it your app? Or some other business?
Do you have a continuity plan to support the old app while you develop new one?
Unless the database is for your app only, and ...
3
votes
How do you assess the damage in a system that has been using floats or doubles for money?
You're right in being concerned about the use of floats for monetary amounts. Unless they are just used to calculate something which is then properly represented as a rounded scaled decimal (or an ...
3
votes
Accepted
How to approach this legacy Java project?
Because you have no requirements, your requirements essentially become: make it do what the old thing does, until you are told otherwise. I only know of one way to successfully deal with this.
You ...
3
votes
Accepted
When is there a case for refactoring large parts of a codebase at once? (if ever)
Big and especially non-local refactorings should be a job on their own, with all that implies about planning and being clear upfront what the plan is and how long it will take.
And as you've observed, ...
3
votes
Accepted
What does "legacy signature" mean?
Legacy just means something from the past. In this sort of context it means something from the past that is now disliked and should not be copied.
implode(array $array, string $separator): string is ...
3
votes
What is the safest way to deploy a lot of changes at once to a legacy, monolithic application with no test coverage?
Since you don’t have any automated testing that would find bugs, the next best thing is to make changes while introducing the smallest possible number of new bugs.
Writing good code carefully and code ...
2
votes
Questions to ask a developer about legacy code before they leave?
Cheatsheets
Common errors and their troubleshooting procedures, workarounds
Prioritized list of pending refactorings
List of error that he has not been able to reproduce
Explanation of permissions an ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
legacy × 117refactoring × 18
design × 13
maintenance × 12
unit-testing × 11
project-management × 8
java × 7
c# × 6
design-patterns × 5
architecture × 5
database × 5
testing × 5
documentation × 5
migration × 5
legacy-code × 5
php × 4
programming-languages × 4
database-design × 4
version-control × 4
development-process × 4
tdd × 4
technical-debt × 4
c++ × 3
agile × 3
source-code × 3