The following approach, though being generally discouraged, is acceptable and may be useful in some rare cases.
I'm not sure this sentence is correct; the part that confuses me is though being generally discouraged. It confuses me because it seems nobody use it (according to Google), and this is strange, of course.
I can change it to though it's generally discouraged, which seems to be grammatically correct, but that way the sentence looks awkward to me.