To invoke the name of John F. Kennedy is to enter a political realm in which the fine print of history doesn't count.

The Kennedy lore and legend are recalled by politicians of both parties now, 25 years after the assassination in Dallas. But it is best done carefully, especially by Republicans.By the numbers, Sen. Dan Quayle got his history just about right when he compared his experience and Kennedy's. But he left himself open to the sharpest rebuff of his Wednesday night debate with Sen. Lloyd Bentsen of Texas.

It was as though Bentsen had been waiting for the Kennedy comparison, one Quayle has made before when questions of experience confront him in his Republican vice presidential campaign.

He hit the trigger as soon as Quayle said that he'd had as much experience in Congress as had Kennedy when he sought the presidency.

"Senator," said Bentsen, "I served with Jack Kennedy. I knew Jack Kennedy. Jack Kennedy was a friend of mine. Senator, you're no Jack Kennedy."

Actually, Quayle hadn't claimed that he was, only that he'd been in Congress as long. He was off by two years. Kennedy served 14 years in Congress; Quayle has been there for 12.

But the broader interpretation of Quayle's statement was more effective ammunition for the Democratic vice presidential nominee. It has ignited a barrage of Democratic criticism, and ridicule, of Quayle on grounds that he claimed to be an incipient JFK.

For the record, Kennedy was elected to the House from Massachusetts in 1946, served three terms, was elected to the Senate in 1952 and re-elected in 1958. Quayle was elected to the House in 1976, beat Democrat Birch Bayh to win his Senate seat in 1980, and won a second term in 1986.

Bentsen served three terms in the House, two while Kennedy was there. He returned to Congress in 1971, this time as a senator, defeating George Bush to win the seat.

While Quayle may have walked into a new campaign problem with the Kennedy comparison there are some parallels. Quayle is 41; Kennedy was 43 when he ran for president, 39 when he made a losing bid for a Democratic vice presidential nomination.

Quayle has been under attack for what his critics call a sub-par congressional record. Kennedy faced the same kind of attacks when he began his presidential campaign in 1960. His opponents said he'd accomplished little or nothing in the Senate, and was too often absent.

Even after Kennedy had proven himself in presidential primary elections, detractors questioned his credentials, and complained that his family fortune was buying his way to the nomination.

Republican Rep. William E. Miller, the party chairman who later ran for vice president, said Kennedy was trying to "turn the White House into the house that Jack bought."

With Kennedy on the threshold of the presidential nomination, Harry S. Truman quit as a delegate, saying the national convention was rigged for JFK and suggested that the senator step aside in favor of "someone with the greatest possible maturity and experience."

While some of those accusations echo now, so do the distinctions between the Kennedy of 1960 and the Quayle of 1988.

Kennedy was a World War II hero. Quayle's candidacy got off to a shaky start because of controversy over his Vietnam-era hometown service in the National Guard.

Quayle's academic credentials have been questioned; Kennedy's were not. Kennedy had published two books; he'd won a Pulitzer Prize for "Profiles in Courage."

Richard Goodwin, a Kennedy speechwriter, said the people who questioned his experience in 1960 were on sound ground. "They were right," Goodwin said. "He'd been in Congress a couple of terms and he'd just started serving his second term in the Senate."

"But people perceived in him qualities of intelligence and sympathy or understanding, whatever the voters were looking for."

The experience argument was replayed in 1962 when Edward Kennedy sought the Democratic nomination to succeed his brother. Edward J. McCormack, the state attorney general, ran against him.

"If his name was Edward Moore, with his qualifications, with your qualifications, Teddy, if it was Edward Moore, your candidacy would be a joke," McCormack told Kennedy in a televised debate. The observation was accurate, but the backlash was fierce, and the primary was no contest.

The name was Kennedy.