Common libraries in a large team

后端 未结 11 848
眼角桃花
眼角桃花 2021-02-01 23:23

Assume you have five products, and all of them use one or more of the company\'s internal libraries, written by individual developers.

It sounds simple but in practice,

11条回答
  •  自闭症患者
    2021-02-01 23:37

    You have a competing set of goals here. First, a library of reusable components must be open enough that people from the other projects can easily add to it (or submit components to it). If it's too difficult for them to do that, they'll build their own libraries, and ignore the common one, leading to a lot of duplicate code and wasted effort. On the other hand, you want to control the development of the library enough that you can ensure its quality.

    I've been in this position. There's no easy answer. However, there are some heuristics that can help.

    • Treat the library as an internal project. Release it on regular intervals. Ensure that it has a well-defined release procedure, complete with unit tests and quality assurance. And, most important, release often, so that new submissions to the library show up in the product frequently.
    • Provide incentives for people to contribute to the library, rather than just making their own internal libraries.
    • Make it easy for people to contribute to the library, and make the criteria clear-cut and well-defined (e.g., new classes must come with unit tests and documentation).
    • Put one or two developers in charge of the library, and (IMPORTANT!) allocate time for them to work on it. A library that is treated as an afterthought will quickly become an afterthought.

    In short, model the development and maintenance of your internal library after a successful open source library project.

提交回复
热议问题