Cook the eggplant cubes in boiling water for about 10 mins
Mash boiled eggplant and mix it with the chopped onion and minced garlic
Add the pesto, egg, melted butter, and breadcrumbs and mix until combined. Season with salt and pepper to taste.
Preheat the oven to 350F. Line the bottom of a pie baking dish with half of the tomato slices, cutting them to fit and cover all possible spaces.
Spread the eggplant mixture over the tomatoes
Top with the shredded Cheddar cheese and the rest of the tomato slices on top. Bake for 35-45 minutes or until the tomato slices on top are cooked and the cheese is melted and bubbly.