some time ago, in one of the projects, i've came across an interesting design pattern in a web application… well – actually an anti-pattern. component A of the system included a piece of javacript code from component B… by just adding a path to a component's A web UI!
the arguing was that both components use the same piece of functionality anyway. well – that's not the whole picture, isn't it? the problem here is that now both release cycles are covertly coupled – if component A gets updated and it will touch anything on the “shared” code, it will “magically” explode component B. it might happen in a very subtle way, thus may require quite some time for any1 to actually notice it… and even more to debug, as local development copies probably will use mocked component A, that has “the right version” of the dependency.
fix? as simple as making “shared” code truly shared – in a separate repo, that is used as a dependency by both components. but each component A and B, will now contain a copy of that code… and the problem's gone!