When Mayor Marion Barry recently dropped his longstanding opposition to building a new District prison facility, one of his top aides explained that what changed Barry's mind was the federal government's apparent willingness to finance part or all of the construction.

For years, the mayor had argued against building more warehouses for prisoners. What was needed, he insisted, was to divert, rehabilitate or train first offenders or nonviolent felons to put them into more productive lines of work than burglary, larceny or drug dealing.

Now we are told Barry's main concern all along was to avoid saddling the D.C. taxpayers with another costly construction project. In light of recent comments by a key U.S. senator and U.S. Attorney Joseph diGenova that the federal government might pay for a new facility, Barry has indicated he might go along with such a project.

"I don't think anyone before raised the possibility of 100 percent federal funding, rather than the city borrowing the money," City Administrator Thomas Downs said in explaining Barry's sudden change of heart.

Maybe so. But, perhaps there was more at work here than merely budget considerations and mounting pressure on Capitol Hill for a new facility to relieve crowding at D.C. Jail and Lorton Reformatory.

Barry must take into account the powerful law-and-order mood that has gripped the District, with residents from all parts of the city clamoring for stepped-up police protection and sterner sentencing.

D.C. voters overwhelmingly approved a determinant-sentencing initiative that will guarantee that persons convicted of certain serious crimes will not avoid serving some hard time. The vote, according to some, sent a message that the public believes the courts have become too lenient.

There are other signs.

Neighborhood crime watch programs have begun to flourish, and community groups have become increasingly militant in demanding stepped-up police protection. Low-income and poor families in particular are fed up with being the primary targets and victims of crime.

And, while the police department deserves much credit for the decline in reported serious crimes in recent years, the public remains outraged by the pervasive and wide-open illegal drug trafficking on Washington streets.

For years, Barry has preached the socioeconomic gospel that the only way to break the cycle of crime and violence is to identify, counsel, educate and find jobs for the down and out, who are most likely to commit crimes. The mayor said it didn't make sense to build more prison cells, which are little more than holding tanks and breeding grounds for criminals.

But the public has grown impatient, angry and fearful, and many of Barry's theories have lost some of their political currency, if not their validity. Getting criminals off the streets and creating a more secure environment in prisons appears to be of paramount concern.

It's significant to note that one of the most influential and outspoken proponents for expanding D.C. corrections facilities is Sen. Arlen Specter (R-Pa.), a moderate who is probably one of the most enlightened and knowledgeable authorities on the criminal justice system.

Specter, a former Philadelphia prosecutor, is chairman of the appropriations subcommittee on the District. His views carry extraordinary weight with D.C. officials.

Even before the 99th Congress could be gaveled to order this month, Specter decided to push hard for approval of new or expanded corrections facilites. In so doing, he defined what is likely to become the hotest D.C. issue to be debated this year on the Hill. Virginia congressmen, who have grumbled for years about lapses in security at Lorton, in southern Fairfax County, will be especially interested in where a new facility is placed.

During a recent hearing, Specter strongly hinted that the federal government would be willing to pick up the tab for a new D.C. prison facility -- one indication of his confidence that he has come down on the right side of the issue.

The mayor immediately signaled a willingness to at least consider building a new prison. Barry is no slouch at reading the political winds. He may have decided this time to go with the flow.