views:

41

answers:

3

I've recently begun working in an enterprise software environment with hundreds of different applications all confined to their own "silos." One of my tasks is to try to standardize things a bit, and the first attempt will be a standard event logging. Currently, the company's "standard" is "everyone should use Enterprise Library for logging." What this translates to in reality is that different developers working on different projects implement different logging in different ways, and just most of the time use that library.

To that end, I'm looking to abstract out the actual logging tool behind a "company standard" internally-developed interface. The idea is to move the focus of what a "standard" is away from the implementing tool and towards how it's used. Applications would then use the internal library and not concern themselves with the tool behind the scenes (save for maybe an app.config section, though I already know how to abstract that out with log4net).

However, a problem I'm facing right now is that all of these applications are in separate TFS projects. If I create a project that contains a common library for logging, is there any way for the other projects to reference it? I don't want to distribute the library among each project because they'll get out of sync quickly.

If TFS can't do this, does anybody have any other suggestions?

+1  A: 

TFS does not have the concept of "shared" folders (e.g. like we had with Visual SourceSafe). Workspaces give you some flexibility but that breaks down as soon as you attempt to map the same "shared" folder to more than one project. There are only a couple of options that come to mind that may address your specific situation:

  1. Branch the Logging project into each team project that needs it. When you make changes to the Logging project, you'll need to either A) merge the Logging project changes to each project that it has been branched to ("push") or B) request that each project team making use of the Logging changes perform a merge to get the latest changes ("pull").

  2. As part of the automated build processes for the Logging project, publish the binaries to a well-known location. Have each project that requires the Logging binaries setup a pre-build event that copies the latest version of the Logging binaries into their solution - or - rather than a pre-build event, you could also have the automated build process get the current Logging binaries and add it to the solution (performing check-outs/ins as needed).

There may be other solutions (there usually are) but that's all that's coming to mind off hand.

Hope this helps.

Jeff Bramwell
Yep. Outlined those options in http://stackoverflow.com/questions/3385282/best-practice-to-share-projects-between-solution-trees-msvs-2008-msvs-2010/3390190#3390190
Robaticus
It would appear, based on responses from everyone so far, that these two are the primary options. I'll be honest, and this is based on my experience with this particular environment (which is very different from any environment I've worked in before), both options sound like they'd be difficult to maintain here, with increasing likelihood of problems over time. Much of this is based on the fact that our build/deploy process is a _mess_. (Something else I'm trying to fix.)
David
I think having this as a automated process invites disaster. Imagine that your API/Tool is used on 6 projects and one of those projects needs a major chnage and implements it. Next build the 5 other projects go "kaboom". Instead have all your dependant tools and API's versioned and under source control as @RyanCromwell sugests in his answer.
MrHinsh
Fair enough, I do see the point there. If nothing else, you guys have at least given me some insight/information to take back to my team to consider our options. Thanks!
David
Just to add on to MrHinsh's comment above... I agree. Any time you are working on a shared component, you must always keep compatibility in mind when making changes. If a contract must change, it's always best to change it in a way in which backward compatibility is maintained (e.g. overload a method, create new interface, etc.). If you aren't practicing this concept with shared components, then automating the process is not a good idea.
Jeff Bramwell
A: 

What we have had success doing is creating a separate TFS project with a solution which contains projects for libraries like logging. When we build this solution we deploy the assemblies onto a shared drive on a server. When we need to use one of these libraries we simply add a reference to the assembly by browsing to its location on the server. If you need to make a change to one of these libraries you can do so at anytime. The next time one of the projects which makes use of the assembly is built it will be updated with the new version.

chris
+2  A: 

Jeff's suggestion is the closest to what we would recommend. Consider internal APIs a seperate team project which serve other projects as clients. Those project feed the backlog and the release cycles. You can have CI, Beta, and Release builds as you see fit. Consuming/consumer projects then do is use their selected build as they can appropriately accomodate in their own release cycle. Because your TFS builds will push to a drop location made available, people pull rather than you pushing new releases. Pull is selecting and those assemblies should be checked-in and version controlled within the consuming project. This is no different than you would do with a true 3rd party assembly, in fact you should consider these in the same light.

When consuming applications have the need or bandwidth to upgrade to your newer versions of the internal assemblies, they pull.

Ryan Cromwell