NPI: TaxonomySession

When working with the new taxonomy support in SharePoint 2010, the TaxonomySession class is high in the food-chain. The taxonomy functionality is provided through the new Service Application architecture and a central piece in accessing these is the SPServiceContext class.

When looking at the constructors of the TaxonomySession, it’s a complete mystery why one can only create one based on an SPSite and not SPServiceContext; especially when there is an internal constructor that takes a SPServiceContext.

For most use this may not be a problem, but think about deployment. During the deployment process you may want to populate a number of term sets because they will be used by site collections; you cannot create the term set unless you have a site that depends on the term set. Sure you could get around this by creating a dummy site collection, but why should you jump through these hoops?

Does anybody have a rational explanation why the internal constructor isn’t exposed? This is just one out of many examples on how SharePoint forces a certain way of programming on developers.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: