WebParts: What's a Hybrid Webpart?

Besides ASP.Net 2.0 and SharePoint 2003 legacy web parts, there is a third floavour of web parts "HYBRID Web parts". Hybrid web parts just like sharepoint legacy web parts, inherit from Microsoft.SharePoint.WebPartPages.WebPart. Hybrid web parts use ASP.Net 2.0 web parts use ASP.Net 2.0 web part development techniques and capabilities combined with SharePoint Capabilities.

There are a couple of things u can do to make a web part HYBRID.

1). Use IPersonalizable interface. This interface is new in .Net 2.o and definies the capabilities for the extraction of personalization state.
2). Use the [ Personalizable ] attribute, which enables a particular property on a web part for personalization.
3). Omit the use of XML serialization attributes.

Drawbacks associated with creating hybrid web parts. Things we can do in a normal sharepoint web part but cannot do in Hybrid Webparts.

a). Hybrid web parts cannnot return tool parts via the GetToolParts() method. Instead, you will need to use controls that inherit from the EditorPart Class via the CreateEditorPart() Method.
b). Properties within a hybrid webpart that are serializable will not be persisted unless you define a type converter for them.

Some sharepoint capabilities can be leveraged with in hybrid web parts. These capabilities are considered advantages of hybrid web parts :

i). You can use the SharePoint 2003 web part caching framework to store items per user or per web part in memory or SQL server.
ii). You can use the sharepoint 2003 web part connection interfaces. you might want to use these interfaces when you want to create web parts that support cross page connections or client side communication.
iii). You can use the asynchronous features of web parts.

Although you will not see hybrid web parts used often but it is good to know they exist. In MOSS 2007 we donot recommend you to create hybrid webparts any more.

Book reffered for article : Pro Sharepoint 2007 Development Techniques By Margriet Bruggeman