Oleg Savelyev
Oleg Savelyev

Reputation: 968

Best practices for creating a shared code library for SharePoint projects

I have several projects for SharePoint 2010 (mostly they are separate solutions builded each to separate wsp's) in active development. And I have a similar tasks in these projects (logging, configuration and so on) so there are a same parts of code (or even classes) in different projects.

I though how to implement these parts as shared code library. But the main trouble is that I need to able adding new features to this library, hence it will require to adapt each depended project to this changes, because library assembly is putted in GAC and used by all projects. But it's to hard to support old and finished projects only for using new features from library in other project.

Currently I use a separate library instance per project with different libraries name. But it also causes repeating of code and additional work for moving new feature from one library instance to another.

I was thinking about library versioning but didn't a deep exploration of it.

Please give me an advices about best practices for this problem resolving, as this is no especialy related to SharePoint, but to any system with modular architecture.

Thanks in advance.

Upvotes: 0

Views: 464

Answers (1)

Vladi Gubler
Vladi Gubler

Reputation: 2458

If you leave the old methods in the library as is and only add new ones, the old code will work just fine. I would suggest deploying the library as a separate WSP, so you can update it separately from the projects themselves.

Upvotes: 1

Related Questions