Sprinkle the eggplant with salt. Place the eggplant in a colander, and let it drain for 30 minutes.
Rinse the eggplant, and pat it dry.
Cook the ziti al dente according to the package directions.
Drain and rinse the pasta, and set it aside. Combine the oil and garlic, and smear it on the eggplant slices.
Then sprinkle the slices generously with pepper.
Broil the eggplant slices about 4 inches from the heat, turning them once, for a total of about 5 minutes.
(You may have to do this in 2 batches.) In a large bowl, combine the ricotta or cottage cheese, all but 2 tablespoons of the parmesan, the parsley, basil, oregano, and pepper flakes.
Toss the cheese mixture with the ziti.
On the bottom of a 2-= to 3 quart casserole, spread a thin layer of tomato sauce, add half the ziti mixture, then half the eggplant slices, then half the remaining tomato sauce. Repeat the ziti, eggplant, and sauce layers.
Top with the reserved 2 tablespoons of parmesan.
Cover the casserole, and bake it in a preheated 400 degree oven for 30 minutes.
Remove the cover, and bake the casserole for another 15 minutes or until the top is lightly browned.