Are code generators bad?

后端 未结 26 1686
耶瑟儿~
耶瑟儿~ 2021-02-07 07:44

I use MyGeneration along with nHibernate to create the basic POCO objects and XML mapping files. I have heard some people say they think code generators are not a good idea. Wha

26条回答
  •  暖寄归人
    2021-02-07 08:22

    The best application of a code generator is when the entire project is a model, and all the project's source code is generated from that model. I am not talking UML and related crap. In this case, the project model also contains custom code.

    Then the only thing developers have to care about is the model. A simple architectural change may result in instant modification of thousands of source code lines. But everything remains in sync.

    This is IMHO the best approach. Sound utopic? At least I know it's not ;) The near future will tell.

提交回复
热议问题