Television weddings are as old as test patterns. From the day Simon wed Vicky on A Country Practice, and Scott and Charlene on Neighbours to the double wedding of Darcy wed Elizabeth and Bingley and Jane in the critically exalted TV adaptation of Pride & Prejudice, they have been a staple of popular culture.

Modern Family's The Wedding: Mitch (Jesse Tyler-Ferguson) and Cam (Eric Stonestreet) make it down the aisle.

To that honour roll we can add Carol and Mike (The Brady Bunch), Matthew and Mary (Downton Abbey), Pam and Jim (The Office), Luke and Laura (General Hospital), Joanie and Chachi (Happy Days) and Monica and Chandler (Friends) to name but a half-dozen more.

But the wedding of Mitchell Pritchett (Jesse Tyler Ferguson) and Cameron Tucker (Eric Stonestreet) - on the American television comedy Modern Family - has been a year in the planning and the splendid, ludicrous, hilarious finish was well worth the wait.

Modern Family, about three branches of one family tree, has a proven track record of doing multi-layered story-telling well, and as multi-layered stories go The Wedding parts one and two were built like a wedding cake.

As usual, however, the finest touches were not front and centre but played as small notes in a bigger arrangement; from Mitch and Cam's promiscuous-to-pregnant officiant Sal (Elizabeth Banks) who opens proceedings with the line, "There once was a homo named Tucker ...", to Pepper's team of hysterical wedding planners and the Biblical plague-themed sequence of wedding mishaps: flood (Sal's waters breaking), fire, darkness and, finally, locusts, in the form of a clashing wedding party named Lucas.

"You don't see this as another Biblical sign? A swarm of Lucases?" declared Cam.

The show's executive producer, creator and lead writer Steven Levitan said at a US press event prior to the show's broadcast: "Our unofficial motto is comedy first.

"We want emotion, we want to send a message but if it's not funny then people are going to lose interest really fast. So I think its got an abundance of heart but I also think that it's a really funny episode."

In the end, though, sentimentality must trump silliness. That's how Modern Family does it.

Mitch's estrangement from his father is resolved beautifully when Jay steps into the mayhem at the 11th hour, after a succession of wedding venues have failed and the wedding looks doomed to fail, and saves the day by moving the nuptials to his conservative country club. As the wedding begins, Jay says simply to Mitch: "I thought you and I should take a little walk."

Father walks son down the aisle, and in a tender moment Mitch rests his head on his father's shoulders. It seems strange that a scripted television comedy's finest moment could be one which plays for poignancy over laughs, and is delivered without a word of dialogue. But there it is: tender and profound.

"If you are going to have a very sincere moment you have to earn those moments," says Ferguson. "You have to make sure the audience is with you and knows those characters. That's how we can go to this place of having a really beautiful wedding because the audience knows these characters."

The secret to Modern Family's success as a television comedy is the improbable, sometimes almost impossible, way it balances being both ridiculous and poignant. Often at the same time.

The absurdity of some of its situations and dialogue is forgiven without a thought by the astonishingly real performances of its cast.

Jay, Gloria, Claire, Phil, Mitch, Cam, Hayley, Alex, Luke, Manny and Lily don't play like characters in a television comedy. They possess a rare warmth which makes them seem like an actual, relatable family.

But it is also due in large part to the writing, led by writer/producers Christopher Lloyd and Levitan, which has carefully navigated the issue of marriage equality with nuance and respect.

In the case of Mitch and Cam, their story is significant because their sexuality and stability was presented in the pilot episode of the series in 2009 as a fait accomplit, complete with infant child introduced memorably to the strains of Elton John's The Circle of Life.

Theirs was not a "coming out" story, nor one of "acceptance". In the Pritchett-Dunphy-Delgado family they simply lived, loved and flourished. This meant that for their wedding - a "gay wedding" in the popular culture zeitgeist as a very real marriage equality debate takes place in the nearby world of politics - getting the balance right was important.

"It wasn't just another episode because we had a lot of moving parts," says O'Neill. "It was very important to a lot of people on the show: a lot of writers, a lot of actors, guest actors. We were very much in concert with getting it right, and hopefully we did."