You need a large cardoon to feed four, as you cut away the tops of the plant and pick off the outer ring of stalks, which are always punky and bitter. Look for stalks with a white bloom on them that comes off when you rub it with your fingers. In stores, cardoons are typically pre-cut and trimmed, so you can use whatever you buy.
Bring a large pot of salty water to a boil and preheat the oven to 400°F. While the water is heating, use your fingers to zip off the little strings on the ribs of the cardoon stalks. You don’t have to get them all, just do your best. Don’t dig too deep or you will break the stalk.
Juice one lemon and pour the juice into a large bowl of cold water. Chop the cardoon stalks into batons of whatever length you like; I like 2-inch batons. Put the cut cardoons into the lemon water to keep them from discoloring.
Toss the already squeezed lemon pieces into the boiling water, then whisk in the flour. Let this boil for a minute or two. The lemon-salt-flour combo affects the cardoons in some way that keeps them a pretty light green and removes some of the bitterness. (This is author Paula Wolfert's trick.) Toss in the cardoons and boil for 40 minutes.
Smear butter, olive oil or bacon fat all over the inside of a casserole just large enough to hold the cardoon pieces in one layer. When the cardoons are done, arrange them in the casserole. Sprinkle over the mozzarella, then the pecorino. Bake for about 35 minutes, or until the cheese begins brown.
Serve with a wedge of lemon and freshly ground black pepper. Eat this with a malty beer or a shot of grappa or ouzo -- it's not a very wine-friendly dish.