SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do apoligize in advance for that's a probably silly question but... I'm developing a custom Sharepoint Webpart and, for the sake os SOLID principle, I need to embed certain functionalities in separate class files. Except from creating a class library is it possible to embed a class into the webpart project and use it into webpart's class?

share|improve this question

No, in SharePoint development you should repeat blocks of code in each monolithic web part class.


Yes, it is a good practice to have shared generic classes for your web parts, feature receivers, etc. Another good idea is to have your own base web part class to derive from.

share|improve this answer
I'm not able to cast an up vote for you but thank you very much! :) – mamoo Jan 27 '11 at 9:45
Give a tick. Only the questioner can do this. – Neil Richards Jan 27 '11 at 9:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.