OOP vs macro problem

前端 未结 7 1331

I came across this problem via a colleague today. He had a design for a front end system which goes like this:

class LWindow
{
   //Interface for common meth         


        
7条回答
  •  情歌与酒
    2021-01-04 13:16

    Oh man this is confusing.

    OK, so L*** is a hierarchy of interfaces, that's fine. Now what are you using the p_Impl for, if you have an interface, why would you include implementation in it?

    The macro stuff is of course ugly, plus it's usually impossible to do. The whole point is that you will have different implementations, if you don't, then why create several classes in the first place?

提交回复
热议问题