Wash and clean the broccoli and cut into florets. Bring some salted water to the boil and pre-cook the broccoli in it for approx. 5 minutes. Drain and drain.
Wash, quarter and core the tomatoes, cut into fine strips without stems. Also cut the ham into strips. Peel the onion and dice it very finely.
Melt the butter and sweat the onions in it until translucent. Scatter the flour on top and sweat until golden brown while stirring. Gradually stir in the milk and reduce everything to a thick sauce.
Dice both types of cheese and let them melt in the sauce, bring to the boil once and season with salt and pepper. Preheat the oven to 200 ° C.
Butter a gratin dish. Layer the broccoli, tomatoes and ham in the pan and season. Pour the sauce over the vegetables. Bake in the oven for about 15 minutes.