Skip to main content
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.
kevin cline's user avatar
  • 33.7k
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 ...
Robert Harvey's user avatar
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 ...
David Arno's user avatar
  • 39.5k
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 (...
Greg Burghardt's user avatar
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 ...
Ewan's user avatar
  • 78.6k
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 ...
amon's user avatar
  • 135k
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 ...
Ludwig Schulze's user avatar
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 ...
gnasher729's user avatar
  • 46.8k
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 ...
ShapeOfMatter's user avatar
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 ...
Nachiappan Kumarappan's user avatar
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 ...
Doc Brown's user avatar
  • 212k
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; } ...
Ewan's user avatar
  • 78.6k
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 ...
f222's user avatar
  • 1,040
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, ...
Jon Raynor's user avatar
  • 11.7k
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 ...
amon's user avatar
  • 135k
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" ...
Doc Brown's user avatar
  • 212k
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 ...
Ewan's user avatar
  • 78.6k
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. ...
Greg Burghardt's user avatar
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, ...
Kain0_0's user avatar
  • 16.3k
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 ...
Ewan's user avatar
  • 78.6k
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 ...
Pavel Penev's user avatar
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 ...
BobDalgleish's user avatar
  • 4,724
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 ...
JacquesB's user avatar
  • 60.3k
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 ...
Thomas's user avatar
  • 49
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 ...
Hans-Martin Mosner's user avatar
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 ...
JimmyJames's user avatar
  • 28.5k
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, ...
pjc50's user avatar
  • 14.6k
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 ...
bdsl's user avatar
  • 3,884
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 ...
gnasher729's user avatar
  • 46.8k
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 ...
Tulains Córdova's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible