For custom development of Content Types, which approach should be f开发者_运维百科ollowed, Declarative Approach (via element.xml) vs Programmatic Approach (via code)? What are the pros and cons of each approach?
I think you should use code.
Details can be found here: https://sharepoint.stackexchange.com/questions/13953/best-way-to-package-publishing-content-types
Declarative approach is preferred. However, the major disadvantage of declarative approach is that there is no standard way of upgrading the content types. Up gradation is normally done in this case by writing the feature receiver which makes the necessary corrections through WSS API.
精彩评论